nextgenhealthcare / connect

The swiss army knife of healthcare integration.
Other
868 stars 265 forks source link

Need guidance on how we can connect to Azure service bus and able to send the message to ASB queue through JMSSender as one of the destination #6196

Closed gpatil-github closed 1 month ago

gpatil-github commented 1 month ago

Describe the bug Recently we are trying to move from ActiveMQ to Azure Service bus. In current ActiveMQ config we have a JMSSender configured with destination as one of the queue and specified below properties in channel destination:

  1. Connection Factory class: org.apache.activemq.ActiveMQConnectionFactory
  2. connection properties: brokerURL, useCompression and closeTimeout
  3. specified queue and its name This is working fine with lib active-all jar added in custom-lib directory.

But when we are trying to do the same for Azure Service bus its failing with below error: ERROR 2024-05-14 10:19:12.352 [JMS Sender Process Thread on HL7 Default JMS - ASB (80738b92-2a61-44e2-854a-65e1c9acd02f), Destination 1 (1)] com.mirth.connect.connectors.jms.JmsDispatcher: An error occurred in channel "HL7 Default JMS - ASB": This ServiceBusJmsConnectionFactory object is not initialized with the proper parameters. java.lang.RuntimeException: This ServiceBusJmsConnectionFactory object is not initialized with the proper parameters. at com.microsoft.azure.servicebus.jms.ServiceBusJmsConnectionFactory.ensureInitialized(ServiceBusJmsConnectionFactory.java:393) ~[azure-servicebus-jms-1.0.2.jar:?] at com.microsoft.azure.servicebus.jms.ServiceBusJmsConnectionFactory.createConnection(ServiceBusJmsConnectionFactory.java:240) ~[azure-servicebus-jms-1.0.2.jar:?] at com.mirth.connect.connectors.jms.JmsDispatcher.getJmsConnection(JmsDispatcher.java:291) ~[jms-server.jar:?] at com.mirth.connect.connectors.jms.JmsDispatcher.send(JmsDispatcher.java:141) ~[jms-server.jar:?] at com.mirth.connect.donkey.server.channel.DestinationConnector.handleSend(DestinationConnector.java:904) ~[donkey-server.jar:?] at com.mirth.connect.donkey.server.channel.DestinationConnector.process(DestinationConnector.java:527) ~[donkey-server.jar:?] at com.mirth.connect.donkey.server.channel.DestinationChain.doCall(DestinationChain.java:122) ~[donkey-server.jar:?] at com.mirth.connect.donkey.server.channel.DestinationChain.call(DestinationChain.java:64) ~[donkey-server.jar:?] at com.mirth.connect.donkey.server.channel.Channel.process(Channel.java:1850) ~[donkey-server.jar:?] at com.mirth.connect.donkey.server.channel.Channel.dispatchRawMessage(Channel.java:1302) ~[donkey-server.jar:?] at com.mirth.connect.donkey.server.channel.SourceConnector.dispatchRawMessage(SourceConnector.java:194) ~[donkey-server.jar:?] at com.mirth.connect.server.controllers.DonkeyEngineController.dispatchRawMessage(DonkeyEngineController.java:1145) ~[mirth-server.jar:?] at com.mirth.connect.server.controllers.DonkeyMessageController.reprocessMessages(DonkeyMessageController.java:449) ~[mirth-server.jar:?] at com.mirth.connect.server.api.servlets.MessageServlet$1.run(MessageServlet.java:224) ~[mirth-server.jar:?] at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_282]

To Reproduce Steps to reproduce the behavior:

  1. Add below jars under custom-lib directory: azure-core-1.49.0.jar, azure-servicebus-jms-1.0.2.jar, javax.jms-api-2.0.1.jar
  2. redeploy the channel try to process a message
  3. specified below properties in channel destination:
  4. Connection Factory class: com.microsoft.azure.servicebus.jms.ServiceBusJmsConnectionFactory
  5. connection properties: brokerURL as ConnectionString, useCompression and closeTimeout
  6. specified queue and its name

Expected behavior Looking for a way configure a JMSSender which can send the message to ASB queue

Environment (please complete the following information):

pacmano1 commented 1 month ago

@gpatil-github - moving this to discussions. You are asking a "How To" here.