WSO2 ESB has a good integration with ActiveMQ queueing platform.
We can have proxies that consume messages from a queue (or topic), call backend for processing or perform orchestration by calling several services and send response to a reply queue.
Environment
In this example, versions of ActiveMQ 5.13 and WSO2 ESB 4.9 are used.
In order WSO2 ESB to communicate with ActiveMQ, we need to:
Copy the following client libraries from <AMQ_HOME>/lib directory to < ESB_HOME>/repository/components/lib
activemq-broker-5.13.2
activemq-client-5.13.2.jar
geronimo-j2ee-management_1.1_spec-1.0.1
geronimo-jms_1.1_spec-1.1.1
hawtbuf-1.11
Enable and configure JMSReceiver and JMSSender for Activemq in conf/axis2/axis2.xml
HTTP to JMS Dual Channel
HTTP -> JMS –orchectration– -> JMS reply
JMS Request Reply Endpoint The endpoint has defined reply destination
JMSRequestReply_endpoint
HTTP to JMS Request and Reply proxy
This HTTP proxy sends message to JMS queue and waits for the response from JMS Reply queue.
The message is received from HTTP forwarded to JMS queue. Out sequence waits for he message from JMS reply queue and forwards it to HTTP Response.
HTTP_JMS_RequestReply
JMS Request Response proxy
This Proxy has JMS transport. It receives the message, processes it and sends reply message in the reply queue. In this proxy we can orchestrate calls to other services/systems, gather results and send resulting message to the reply queue. This message will be forwarder as HTTP response ij the previous proxy, named HTTP 2 JMS Request Reply. Message is transferred from the inSequence to the outSequence with loopback mediator. With payload mediator we can construct new reply message.
Information for receiver and reply queue is placed in the proxy as parameters.
Sending the message
In ActiveMQ web console we can see that the message is enqueued and consumed (dequeued)
HTTP to JMS Asynchronous Channel
For Asynchronous channel, we use property OUT_ONLY = true. The message is put to queue by http proxy but the response is not expected. The endpoint has no Reply queue specified.
JMS Endpoint
Http Sender to JMS queue
To test receiving JMS messages by ESB proxy, we might make helper proxy that will receive SOAP message from a web service (ex. From Soap UI) and send it to a queue.
jmsReceiveAndReply – This is the main proxy. It receives the message from the queue, processes it and sends reply to the reply destination.
Sending the message
In ActiveMQ web console we can see that the message is enqueued. (See Queue1 and Queue1Reply.)
Also in log, we can see log messages.
Conclusion
ActiveMQ has easy and reliable integration with WSO2 ESB. Their setup is straightforward and their runtime functioning is seamless. This blog is about necessary steps and jars for integration of ActivemQ and WSO2 ESB as well as HTTP <-> JMS communication as both protocols are used in enterprise environments. Placing message into a queue can be done easily with HTTP proxy that sends a message to a JMS queue. HTTP to JMS Dual Channel synchronous communication is shown as well as asynchronous communication in the later case.
Jenny Sladjana Gligorovska is an IT expert with 12+ years of experience in enterprise environments developing projects in Telecommunication, CRM, e-Commerce, Payments, Geographic Information Systems and various Governmental fields. Within the development of complex systems, Jenny has been in roles such as Software Architect, Project Manager, Team Leader, and always to the bottom of it: a Developer.
Our services to facilitate the digital transformation of your business
WSO2
Solutions by industry
Learnings
Our Technologies for your Digital Transformation
Search
What kind of content are you looking for?
We appreciate it
Care to share
Please select one of the social media platforms below to share this pages content with the world
Manage Cookie Consent
This website uses cookies. Information about data processing can be found in our privacy policy.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.