SlideShare ist ein Scribd-Unternehmen logo
1 von 14
JMS-2
Vasanthi
JMS
• JMS (Java Message Service) 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:
• Queues - Point-to-point
• Topics - Publish and subscribe
• Mule's JMS transport lets you easily send and receive messages to queues
and topics for any message service which implements the JMS
specification.
Queues
• In the point-to-point or queuing model, a sender posts messages to a
particular queue and a receiver reads messages from the queue. Here,
the sender knows the destination of the message and posts the message
directly to the receiver's queue. It is characterized by the following:
• Only one consumer gets the message
• The producer does not have to be running at the time the
consumer consumes the message, nor does the consumer
need to be running at the time the message is sent
• Every message successfully processed is acknowledged by the
consumer
Configuration with Example:
• Anypoint Studio offers easy-to-use components to connect to JMS Queues
and Topics. In the below example, we will use ActiveMQ, a leading open
source JMS implementation from Apache that supports JMS.
• The outline of the simple steps required to implement this example is as
follows:
• Import ActiveMQ libraries
• Create an ActiveMQ connector
• Enqueue to JMS Queue
• Run the sample
1. Import ActiveMQ Library:
• Download Apache ActiveMQ binaries (ActiveMQ 5.11) from
http://activemq.apache.org/download.html. Unzip the compressed
file to any folder on your file system. Let’s call it <ACTIVEMQ_HOME>.
• Create a new flow in Mule Studio and name it “jms”. To configure the
project to use ActiveMQ libraries, right-click on the project ->
Properties -> Java Build Path -> Add External JARs. Select “activemq-
all-5.11-SNAPSHOT.jar” from <ACTIVEMQ_HOME>.
2. Create an ActiveMQ Connector:
• Double-click on “jms” flow to bring up the message flow. Click on the
“Global Elements” tab. Click on “Create” and locate ActiveMQ under
“Connectors -> JMS” and click OK.
3. Enqueue to JMS Queue:
• We will use the request payload received from an HTTP inbound
endpoint to seed the ActiveMQ Queue. Open the “jms” message flow
and drag and drop an HTTP endpoint on to the flow.
• Double-click on the HTTP endpoint to bring up the properties dialog.
Specify “jms_queue” for Path. This will make the HTTP endpoint
accessible using URL http://localhost:7777/jms_queue.
• Set a payload that you want to add to the queue.
• Drag and drop a JMS endpoint next to the HTTP inbound endpoint.
• Double-click the JMS endpoint to bring up the properties dialog. Specify
“queue” for Queue name.
Select “Active_MQ” for Connection Reference in the Connector Configuration
that we created in Step 2.
4. Create a Jms_receiver :
• Use a Jms endpoint to receive the messages in the queue. Its configuration
is as follows:
• Use a Logger to log the Received Message.
• Use Set-payload to send a response back to the Jms Service.
• The final JMS Receiver Message Flow is as below:
5. Run the sample:
• First, run ActiveMQ using executable “activemq-admin” from
<ACTIVEMQ_HOME>/bin folder. Make sure you can access the ActiveMQ admin
page using http://localhost:8161/.
• Run the JMS flow.
• Open http://localhost:7777/jms_queue.This will enqueue the request to
the ActiveMQ JMS Queue “queue”.
• Verify this by examining the ActiveMQ administration page at
http://localhost:8161/admin/queues.jsp. We can see the messages under
the “Messages Enqueued” column.
• The Output you receive after the execution is the Payload Set by the JMS-
Client.
• Note: Only one client can read from a queue at one time and the messages
read from the queue are removed from the queue. If you want to perform any
transactions on top of JMS then the Transaction settings come in handy.
•Thank You All

Weitere ähnliche Inhalte

Was ist angesagt?

Mule Amazon SNS Connector
Mule Amazon SNS ConnectorMule Amazon SNS Connector
Mule Amazon SNS ConnectorAnkush Sharma
 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in MuleKhasim Saheb
 
Mulesoft vm transport reference
Mulesoft vm transport referenceMulesoft vm transport reference
Mulesoft vm transport referencekumar gaurav
 
Using groovy in mule
Using groovy in muleUsing groovy in mule
Using groovy in muleSon Nguyen
 
Mule requestor component
Mule requestor componentMule requestor component
Mule requestor componentSindhu VL
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored proceduremdfkhan625
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esbPraneethchampion
 
Mule Script Transformer
Mule Script TransformerMule Script Transformer
Mule Script TransformerAnkush Sharma
 
Mulesoft Consuming Web Service - Web Service Consumer
Mulesoft Consuming Web Service - Web Service ConsumerMulesoft Consuming Web Service - Web Service Consumer
Mulesoft Consuming Web Service - Web Service ConsumerVince Soliza
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mulejaveed_mhd
 
Mule JMS Transport
Mule JMS TransportMule JMS Transport
Mule JMS TransportRupesh Sinha
 

Was ist angesagt? (20)

Mule Amazon SNS Connector
Mule Amazon SNS ConnectorMule Amazon SNS Connector
Mule Amazon SNS Connector
 
Mule LDAP Connector
Mule LDAP ConnectorMule LDAP Connector
Mule LDAP Connector
 
Mule java part-1
Mule java part-1Mule java part-1
Mule java part-1
 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in Mule
 
Enabling Security For ActiveMQ JMX Access
Enabling Security For ActiveMQ JMX AccessEnabling Security For ActiveMQ JMX Access
Enabling Security For ActiveMQ JMX Access
 
Using seda in mule
Using seda in muleUsing seda in mule
Using seda in mule
 
Simple VM in Mule
Simple VM in MuleSimple VM in Mule
Simple VM in Mule
 
Mule java part-1
Mule java part-1Mule java part-1
Mule java part-1
 
Mulesoft vm transport reference
Mulesoft vm transport referenceMulesoft vm transport reference
Mulesoft vm transport reference
 
Using groovy in mule
Using groovy in muleUsing groovy in mule
Using groovy in mule
 
Mule requestor component
Mule requestor componentMule requestor component
Mule requestor component
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedure
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Mule Script Transformer
Mule Script TransformerMule Script Transformer
Mule Script Transformer
 
Mule esb introduction
Mule esb introductionMule esb introduction
Mule esb introduction
 
Mule Webservices
Mule WebservicesMule Webservices
Mule Webservices
 
Mulesoft Consuming Web Service - Web Service Consumer
Mulesoft Consuming Web Service - Web Service ConsumerMulesoft Consuming Web Service - Web Service Consumer
Mulesoft Consuming Web Service - Web Service Consumer
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
 
Mule JMS Transport
Mule JMS TransportMule JMS Transport
Mule JMS Transport
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
 

Andere mochten auch

осень
осеньосень
осеньaviamed
 
состав чисел от 2 до 9
состав чисел от 2 до 9состав чисел от 2 до 9
состав чисел от 2 до 9aviamed
 
10 Things You Can Only Do in Brooklyn, from Maria Haymandou
10 Things You Can Only Do in Brooklyn, from Maria Haymandou10 Things You Can Only Do in Brooklyn, from Maria Haymandou
10 Things You Can Only Do in Brooklyn, from Maria HaymandouMaria Haymandou
 
улетают журавли
улетают  журавлиулетают  журавли
улетают журавлиaviamed
 
Transforming Competencies Through Thecnology!
Transforming Competencies Through Thecnology!Transforming Competencies Through Thecnology!
Transforming Competencies Through Thecnology!mycompetencybuilder
 
Chapter 2 mechanical equilibrium watson
Chapter 2 mechanical equilibrium watsonChapter 2 mechanical equilibrium watson
Chapter 2 mechanical equilibrium watsonwatsonma12
 
โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์cakemark
 
710B_Akansha Vaswani & Diego Flores
710B_Akansha Vaswani & Diego Flores710B_Akansha Vaswani & Diego Flores
710B_Akansha Vaswani & Diego FloresDiego Flores
 
растения и животные водоемов
растения и животные водоемоврастения и животные водоемов
растения и животные водоемовaviamed
 
рассказ «волк»
рассказ «волк»рассказ «волк»
рассказ «волк»aviamed
 
лошадка решение примеров
лошадка решение примеровлошадка решение примеров
лошадка решение примеровaviamed
 
Sarah E Heintz Resume
Sarah E Heintz Resume Sarah E Heintz Resume
Sarah E Heintz Resume Sarah Heintz
 
Profile Ashish Prasad 2015
Profile Ashish Prasad 2015Profile Ashish Prasad 2015
Profile Ashish Prasad 2015Ashish Prasad
 

Andere mochten auch (20)

осень
осеньосень
осень
 
Profile me
Profile meProfile me
Profile me
 
Spoorts pain ppt
Spoorts pain pptSpoorts pain ppt
Spoorts pain ppt
 
состав чисел от 2 до 9
состав чисел от 2 до 9состав чисел от 2 до 9
состав чисел от 2 до 9
 
10 Things You Can Only Do in Brooklyn, from Maria Haymandou
10 Things You Can Only Do in Brooklyn, from Maria Haymandou10 Things You Can Only Do in Brooklyn, from Maria Haymandou
10 Things You Can Only Do in Brooklyn, from Maria Haymandou
 
улетают журавли
улетают  журавлиулетают  журавли
улетают журавли
 
Transforming Competencies Through Thecnology!
Transforming Competencies Through Thecnology!Transforming Competencies Through Thecnology!
Transforming Competencies Through Thecnology!
 
Chapter 2 mechanical equilibrium watson
Chapter 2 mechanical equilibrium watsonChapter 2 mechanical equilibrium watson
Chapter 2 mechanical equilibrium watson
 
โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์
 
710B_Akansha Vaswani & Diego Flores
710B_Akansha Vaswani & Diego Flores710B_Akansha Vaswani & Diego Flores
710B_Akansha Vaswani & Diego Flores
 
Argentina: dati macroeconomici 2015 dal Business Atlas
Argentina: dati macroeconomici 2015 dal Business AtlasArgentina: dati macroeconomici 2015 dal Business Atlas
Argentina: dati macroeconomici 2015 dal Business Atlas
 
Resume
ResumeResume
Resume
 
растения и животные водоемов
растения и животные водоемоврастения и животные водоемов
растения и животные водоемов
 
1249320870000 asgn 1-jm (1)
1249320870000 asgn 1-jm (1)1249320870000 asgn 1-jm (1)
1249320870000 asgn 1-jm (1)
 
рассказ «волк»
рассказ «волк»рассказ «волк»
рассказ «волк»
 
лошадка решение примеров
лошадка решение примеровлошадка решение примеров
лошадка решение примеров
 
Sarah E Heintz Resume
Sarah E Heintz Resume Sarah E Heintz Resume
Sarah E Heintz Resume
 
VC
VCVC
VC
 
Book
BookBook
Book
 
Profile Ashish Prasad 2015
Profile Ashish Prasad 2015Profile Ashish Prasad 2015
Profile Ashish Prasad 2015
 

Ähnlich wie JMS API Guide for Messaging with MuleSoft

Ähnlich wie JMS API Guide for Messaging with MuleSoft (20)

Jms queue
Jms queueJms queue
Jms queue
 
M messaging 1
M messaging 1M messaging 1
M messaging 1
 
Jms topics
Jms topicsJms topics
Jms topics
 
Mule jms-topics
Mule jms-topicsMule jms-topics
Mule jms-topics
 
Jms topics
Jms   topicsJms   topics
Jms topics
 
Active mq read and write flow in mule
Active mq  read and write flow in muleActive mq  read and write flow in mule
Active mq read and write flow in mule
 
Jms using j boss
Jms using j bossJms using j boss
Jms using j boss
 
Apache ActiveMQ
Apache ActiveMQ Apache ActiveMQ
Apache ActiveMQ
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
ActiveMQ Configuration
ActiveMQ ConfigurationActiveMQ Configuration
ActiveMQ Configuration
 
Connecting Applications Everywhere with ActiveMQ
Connecting Applications Everywhere with ActiveMQConnecting Applications Everywhere with ActiveMQ
Connecting Applications Everywhere with ActiveMQ
 
Message Driven Beans (6)
Message Driven Beans (6)Message Driven Beans (6)
Message Driven Beans (6)
 
Ranker jms implementation
Ranker jms implementationRanker jms implementation
Ranker jms implementation
 

Mehr von Vasanthii Chowdary (7)

M expression
M expressionM expression
M expression
 
M enrichment
M enrichmentM enrichment
M enrichment
 
M property
M propertyM property
M property
 
M system prop
M system propM system prop
M system prop
 
M filtering
M filteringM filtering
M filtering
 
M split
M splitM split
M split
 
M batching
M batchingM batching
M batching
 

Kürzlich hochgeladen

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 

Kürzlich hochgeladen (20)

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 

JMS API Guide for Messaging with MuleSoft

  • 2. JMS • JMS (Java Message Service) 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: • Queues - Point-to-point • Topics - Publish and subscribe • Mule's JMS transport lets you easily send and receive messages to queues and topics for any message service which implements the JMS specification.
  • 3. Queues • In the point-to-point or queuing model, a sender posts messages to a particular queue and a receiver reads messages from the queue. Here, the sender knows the destination of the message and posts the message directly to the receiver's queue. It is characterized by the following: • Only one consumer gets the message • The producer does not have to be running at the time the consumer consumes the message, nor does the consumer need to be running at the time the message is sent • Every message successfully processed is acknowledged by the consumer
  • 4. Configuration with Example: • Anypoint Studio offers easy-to-use components to connect to JMS Queues and Topics. In the below example, we will use ActiveMQ, a leading open source JMS implementation from Apache that supports JMS. • The outline of the simple steps required to implement this example is as follows: • Import ActiveMQ libraries • Create an ActiveMQ connector • Enqueue to JMS Queue • Run the sample
  • 5. 1. Import ActiveMQ Library: • Download Apache ActiveMQ binaries (ActiveMQ 5.11) from http://activemq.apache.org/download.html. Unzip the compressed file to any folder on your file system. Let’s call it <ACTIVEMQ_HOME>. • Create a new flow in Mule Studio and name it “jms”. To configure the project to use ActiveMQ libraries, right-click on the project -> Properties -> Java Build Path -> Add External JARs. Select “activemq- all-5.11-SNAPSHOT.jar” from <ACTIVEMQ_HOME>.
  • 6.
  • 7. 2. Create an ActiveMQ Connector: • Double-click on “jms” flow to bring up the message flow. Click on the “Global Elements” tab. Click on “Create” and locate ActiveMQ under “Connectors -> JMS” and click OK.
  • 8. 3. Enqueue to JMS Queue: • We will use the request payload received from an HTTP inbound endpoint to seed the ActiveMQ Queue. Open the “jms” message flow and drag and drop an HTTP endpoint on to the flow. • Double-click on the HTTP endpoint to bring up the properties dialog. Specify “jms_queue” for Path. This will make the HTTP endpoint accessible using URL http://localhost:7777/jms_queue. • Set a payload that you want to add to the queue. • Drag and drop a JMS endpoint next to the HTTP inbound endpoint. • Double-click the JMS endpoint to bring up the properties dialog. Specify “queue” for Queue name.
  • 9. Select “Active_MQ” for Connection Reference in the Connector Configuration that we created in Step 2.
  • 10. 4. Create a Jms_receiver : • Use a Jms endpoint to receive the messages in the queue. Its configuration is as follows:
  • 11. • Use a Logger to log the Received Message. • Use Set-payload to send a response back to the Jms Service. • The final JMS Receiver Message Flow is as below: 5. Run the sample: • First, run ActiveMQ using executable “activemq-admin” from <ACTIVEMQ_HOME>/bin folder. Make sure you can access the ActiveMQ admin page using http://localhost:8161/.
  • 12. • Run the JMS flow. • Open http://localhost:7777/jms_queue.This will enqueue the request to the ActiveMQ JMS Queue “queue”. • Verify this by examining the ActiveMQ administration page at http://localhost:8161/admin/queues.jsp. We can see the messages under the “Messages Enqueued” column.
  • 13. • The Output you receive after the execution is the Payload Set by the JMS- Client. • Note: Only one client can read from a queue at one time and the messages read from the queue are removed from the queue. If you want to perform any transactions on top of JMS then the Transaction settings come in handy.