'Call rabbitmq using SQL Server CLR

I have implemented this article to call rabbitmq inside SQL Server:

[https://nielsberglund.com/2017/02/11/rabbitmq---sql-server/][1]

But when I try to send a message using the CLR I get this error:

Msg 50000, Level 16, State 1, Procedure pr_SomeProcessingStuff, Line 43
Error: A .NET Framework error occurred during execution of user-defined routine or aggregate "pr_clr_PostRabbitMsg":

System.ApplicationException: Channel pool blocked when trying to post message to Exchange: amq.topic.

System.ApplicationException:
at RabbitMQSqlClr.RabbitPublisher.Post(String exchange, Byte[] msg, String topic)
at RabbitMQSqlClr.RabbitMQSqlServer.pr_clr_PostRabbitMsg(Int32 endPointId, String msgToPost)
at line: 0 at line: 13

This is my rabbit config

enter image description here



Solution 1:[1]

Firstly, big thanks to @NielsBerglund for giving us RabbitMQ-SqlServer.

I have just resolved the same error after a quite a few hours of head banging.

I was able to use the console app in the VS solution Neils provided to send a message between the two different servers (database server and application server), therefore proving that firewalls etc were not blocking the message.

However, executing the SQL CLR stored procedure within SQL Management Studio always returned the channel pool blocked error.

After much tinkering, I noticed that changing the exchange name in tb_RabbitEndpoint (using pr_UpsertRabbitEndpoint) was still returning the exact same error message, referencing the previous exchange name.

I was able to resolve this by re-configuring SQL CLR:

EXEC sp_configure 'CLR Enabled', 0

GO

RECONFIGURE

GO

EXEC sp_configure 'CLR Enabled', 1

GO

RECONFIGURE

GO

EXEC rmq.pr_clr_InitialiseRabbitMq;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Paul Logan