0

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

5
  • Is your SQL Server and Rabbit on the same box, if not - check firewalls. Commented Sep 19, 2020 at 13:20
  • @NielsBerglund They are on the same box Commented Sep 19, 2020 at 13:41
  • @NielsBerglund which port should be set ? Commented Sep 19, 2020 at 13:45
  • Hi Ehsan, the port is 5672. Have you tried the CLR code from a console appplication? I.e. create a console application and reference the dll you deploy to SQL Server, and run from console and see what happens. Commented Sep 20, 2020 at 3:58
  • @NielsBerglund thank you very much .No I haven't ,Which dll should I reference ? Commented Sep 20, 2020 at 4:25

1 Answer 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;

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.