CONTENTS: MULESOFT ANYPOINT STUDIO JMS(Java Message Service)
MULESOFT Mule, the runtime engine of Anypoint Platform, is a lightweight Java-based enterprise service bus (ESB) and integration platform that allows developers to connect applications together quickly and easily, enabling them to exchange data. It enables easy integration of existing systems, regardless of the different technologies that the applications use, including JMS, Web Services, JDBC, HTTP, and more. Mule has powerful capabilities that include: Service creation and hosting Service mediation Message routing Data transformation
ANYPOINT STUDIO Accelerate developer productivity with a single graphical environment for SOA, SaaS, APIs and data integration, then deploy your applications with one click to the Mule runtime, on-premises or in the cloud. Design and implement APIs with unified tooling Build, edit, document and debug integrations graphically or in XML Simplify data mapping and transformation Complete support for the entire build-to-deploy process Jumpstart your integrations with pre-built components
JAVA MESSAGE SERVICE(JMS) JMS is a widely-used API for message oriented middleware. It allows communication between different components of a distributed application to be loosely coupled, reliable and asynchronous. JMS supports two models for messaging: Point to point ( QUEUES ) Publish and subscribe( TOPICS ) It also have five elements: Client Publisher Consumer Message queue
JMS for QUEUES For a file to be placed in JMS queue, the following connectors are used as given below: The following connectors are used: File File to string JMS
File Connector: The File connector allows your Mule application to exchange files within the local file system. You can implement the File connector as an inbound endpoint (such as, a message source), or as an outbound endpoint. This endpoint implements a one-way exchange pattern only. File to string Transformer: File-To-String element configures a transformer that reads the content of java.io.File into a java.lang.String. JMS Connector: JMS is mostly used API enabling the application to communicate through the exchange of message. JMS connector is capable of sending and receiving message to and from queues/topics.
For a JMS queue to dequeue the following connectors are used:
Steps to be followed: Drag and drop file connector, file to string transformer and JMS connector. open file properties and provide path to insert files to queue.
3. Open JMS properties select one way , provide queue name and do connector configuration i.e., Active_MQ 4. A dialog box opens then select Active_MQ as shown below
5. Configure Active_MQ with admin as username and password and press ok. 6. Now go to apache_Active_MQ and run wrapper.
7. Open browser and type localhost:8161 and enter. 8. A page will be opened and then select manage activeMQ broker.
9. Then type admin as username and password. 10. Select queue on the top left and check given queue is in the list or not.
11. Now if we run the project a file will be queued but an error occurs because jar files are missing. 12. To add jar files, right click on project and select build path and then configure build path
13. Properties window open where select libraries and add external jars 14. Select the jar file as below
15. Check whether the jar file has been added or not and press apply and then ok. 16. Now right click on project and press run as mule project.