SlideShare a Scribd company logo
SKILLWISE-JMS
USING JBOSS
Table Of Contents
2
 Introduction to JMS
 JMS concepts
 JMS API Architecture
 JMS Application
 JBossMQ
 Getting started with JBossMQ
Introduction to JMS
• Java Message Services, JMS, is Sun's standard API for message queuing
systems.
• JMS provides a flexible and powerful API that encourages a fine-grained,
modular distribution of functionality among application components.
• Why use JMS?
• JMS has two message protocols: point to point and publisher/subscriber
instead of only one, as many earlier middleware systems.
• Asynchronous Messaging
3
Introduction to JMS (contd…)
• Lose coupling, meaning reduced complexity as components depend less on each
other.
• Store-and-forward/Guaranteed delivery - Message is "held back" by the JMS
provider in case receiver is not ready, and delivered as soon as the receiver is
ready.
• Quality of Service Enforcement - e.g. higher priority message delivered before
low priority, drop old messages before they reach consumers etc.
• Easy to learn programming model.
4
JMS concepts
• A JMS provider is a messaging system that implements JMS and
• provides administrative and control features.
• JMS clients are the programs or components, written in the Java,
• that produce and consume messages.
• Messages are the objects that communicate information between
• JMS clients.
• Administered objects are preconfigured JMS objects created by an
• administrator for the use of clients.
• Two kinds of administered objects are Destinations and
• Connection Factories.
5
Messaging Domains
• Point-to-Point (PTP)
• The Point-to-Point model calls the destination objects ‘queues’.
• Each message has only one consumer.
• Each queue can have multiple consumers.
• A sender and receiver have no time dependencies.
• The receiver acknowledges the successful processing of a message.
• Use PTP when every message you send must be processed
• successfully by one consumer.
6
Messaging Domains (contd…)
• Publish/Subscribe
The Pub-Sub model, calls the destination objects ‘topics’.
• Each message may have multiple consumers.
• Publishers and subscribers have timing dependencies.
• Publishers and subscribers are generally anonymous and the system takes
care of distributing the messages.
7
Message Consumption
• Messages can be consumed in either of two
ways:
• Synchronously:
A subscriber or a receiver explicitly fetches the message from the destination
by calling the receive method.
The receive method can block until a message arrives or can time out if a
message does not arrive within a specified time.
• Asynchronously:
A client can register a message listener with a consumer. A message listener is
similar to an event listener.
Whenever a message arrives at the destination, the JMS provider delivers the
message by calling the listener’s onMessage() method, which acts on the
contents of the message.
8
JMS API Architecture
• 1: Bind destinations and connection factories objects.
• 2. Client looks up for administered objects in the namespace.
• 3. Establish a logical connection to the looked up object
• through a JMS provider.
9
The basic building blocks of a JMS application
10
The basic building blocks of a JMS application
(contd…)
• Administered Objects:
Connection Factories: A connection factory is the object
a client uses to create a connection with a provider
Destinations: A destination is the object a client uses to
specify the target of messages it produces and the
source of messages it consumes
• Sessions: A session is a single-threaded context for producing and consuming
messages. You use sessions to create message producers, message consumers, and
messages.
• Message Producers:A message producer is an object created by a
session and is used for sending messages to a destination.
11
The basic building blocks of a JMS application
(contd…)
• Message Consumers:A message consumer is an object created by
a session and is used for receiving messages sent to a destination.
• Messages
• A JMS message has three parts:
• A Header
• Properties (optional)
• A Body (optional)
12
Basic Steps for writing a JMS application
• Get the JNDI initial context.
• Look up a connection factory (for the right type of destination, topic or queue).
• Obtain a connection from the factory.
• Create a session tied to the connection.
• Look up the destination (topic or queue).
• Create a message producer or a message consumer (specific for the topic or the
queue).
13
Basic Steps
• 1) Get the JNDI initial context
• Create a file named jndi.properties with the following lines:
• Client jndi.properties file example:
•
java.naming.factory.initial=org.jnp.interfaces.NamingCont
extFactory java.naming.provider.url=localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.int
erfaces
• // Get the initial context
• Context context = new InitialContext();
14
Basic Steps (contd…)
• 2) Look up a connection factory
• For Topic
• TopicConnectionFactory topicFactory =
(TopicConnectionFactory)
context.lookup("ConnectionFactory");
• For Queue
• QueueConnectionFactory queueFactory =
(QueueConnectionFactory)context.lookup("Connec
tionFactory");
15
Basic Steps (contd…)
• 3) Obtain a connection from the factory
• For Topic
• TopicConnection topicConnection =
topicFactory.createTopicConnection();
•
• For Queue
• QueueConnection queueConnection =
• queueFactory.createQueueConnection();
16
Basic Steps (contd…)
• 4) Create a session tied to the connection
• For Topic
• TopicSession topicSession =
• topicConnection.createTopicSession(false,
•
Session.AUTO_ACKNOWLEDGE);
• For Queue
• QueueSession queueSession =
• queueConnection.createQueueSession(false,
•
Session.AUTO_ACKNOWLEDGE);
•
17
Basic Steps (contd…)
• 5) Look up the destination
• For Topic
• Topic topic = (Topic)context.lookup("topic/testTopic");
• For Queue
• Queue queue =
(Queue)context.lookup("queue/testQueue");
• Note: that in JBossMQ the prefix topic/ is always placed before
• the topic name and the prefix queue/ is always placed before
• the queue name.
•
18
Basic Steps (contd…)
• 6) Create a message producer
• For Topic create publisher
• TopicPublisher topicPublisher =
topicSession.createPublisher(topic);
• For Queue create sender
• QueueSender queueSender =
queueSession.createSender(queue);
19
Basic Steps (contd…)
• 7) Create a TextMessage
• For Topic create TextMessage and publish it
• TextMessage message =
topicSession.createTextMessage();
• message.setText(message);
• topicPublisher.publish(topic, message);
• For Queue create TextMessage and send it
• TextMessage message =
queueSession.createTextMessage();
• message.setText(message);
• queueSender.send(queue, message);
20
Basic Steps (contd…)
• 8) Create a message consumer
• For asynchronous receiving implement a Message Listener
• interface.
• public class HelloSubscriber implements MessageListener {
• Create and start a topic subscriber
• topicSubscriber = topicSession.createSubscriber(topic);
•
• // Set the message listener
• topicSubscriber.setMessageListener(this);
• topicConnection.start();
•
•
21
Basic Steps (contd…)
• Create and start a queue receiver
• queueReceiver =
queueSession.createReceiver(queue);
• // Set the message listener
• queueReceiver.setMessageListener(this);
• queueConnection.start();
22
JBossMQ
• JBossMQ is composed of several services working together to provide JMS API
level services to client applications.
• JBoss-4.x supports the JMS1.1 version spec.
• JBoss-3.2.x supports the JMS1.0.2b spec.
• It Supports two messaging styles:
• Queue: a message is received by only one client.
• Topic: a message is “broadcast” to multiple client subscribers.
23
Features of JBossMQ
• Asynchronous delivery of messages.
• Guaranteed delivery of message either by persisting the message or by
redelivering it.
• Multi protocol support.
• Pluggable Security to support different security mechanisms.
• Pluggable Persistence to support different persistence mechanisms.
24
Configuring JMS with JBoss
1. Install the JMS service
This is a JMS folder in the deploy directory with *-service.xml
MBean configurations
2. JMS Topics and Queues are implemented as MBeans
3. DestinationManager MBean manages the destinations (queue and topic)
4. The jbossmq-destinations-service.xml defines some default queues and topics
5. To add a new Queue (or topic), add a new entry like this to this file ( or any *-service.xml file) –
• <mbean code="org.jboss.mq.server.jmx.Queue"
•
name="jboss.mq.destination:service=Queue,name=MyQueu
e">
• </mbean>
• This will add a queue by name ‘queue/MyQueue’
25
Running the examples
• For Topic
1) Start the Jboss Server.
2) Run the subscriber.
3) Run the publisher.
• For Queue
1) Start the Jboss Server.
2) Run the sender.
3) Run the receiver.
26
JBoss MQ – Exercise -1
• Configure the queues ‘queue/inputQueue’ and
‘queue/outputQueue’ to the JBoss Server
• Write a program to send java expression strings to the queue.
• For e.g., the program could send the following strings “int
a=1”, “int b=5”, and “int c=a+b” . This program then waits on the
output queue and print the result once it is available.
• Write a program to receive java expressions from the input
queue and evaluate the expression and send the result to the
output queue. (Use bsh shell for Java Expression Evaluation)
27
JBoss MQ – Exercise - 2
• Write a program to serialize an object and
put it in a queue.
• Write a program to receive serialized class
files from a queue, de-serialize the object and
execute methods on the object using Java
reflection.
28
JBoss MQ – Exercise - 3
• Explore persistent messages with
JBossMQ
• Explore users/roles with JBossMQ
29
References
• http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/basics.html
• http://www.coredevelopers.net/library/jboss/jms-dev/j2ee-container.jsp
• http://docs.jboss.org/jbossas/jboss4guide/r3/html/
• http://www.jboss.org/wiki/Wiki.jsp?page=JBossMQ
30
Jms using j boss

More Related Content

PDF
PPT
test
PDF
Enterprise Messaging With ActiveMQ and Spring JMS
PPTX
Spring JMS and ActiveMQ
PPTX
Enterprise messaging with jms
PPTX
Jms deep dive [con4864]
PPTX
Do we need JMS in 21st century?
PPTX
Spring JMS
test
Enterprise Messaging With ActiveMQ and Spring JMS
Spring JMS and ActiveMQ
Enterprise messaging with jms
Jms deep dive [con4864]
Do we need JMS in 21st century?
Spring JMS

What's hot (15)

PPT
Weblogic - Introduction to configure JMS
PDF
ActiveMQ In Action
PDF
JMS - Java Messaging Service
PDF
ActiveMQ In Action - ApacheCon 2011
PDF
Introduction to NServiceBus
PDF
Understanding JMS Integration Patterns
PPT
JMS Introduction
PPTX
Java Message Service
PDF
Ranker jms implementation
PPT
10135 b 02
PDF
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
PPTX
Mule JMS Transport
PPTX
Jms topics
Weblogic - Introduction to configure JMS
ActiveMQ In Action
JMS - Java Messaging Service
ActiveMQ In Action - ApacheCon 2011
Introduction to NServiceBus
Understanding JMS Integration Patterns
JMS Introduction
Java Message Service
Ranker jms implementation
10135 b 02
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
Mule JMS Transport
Jms topics
Ad

Viewers also liked (20)

PPTX
Lempung
PPT
Power point hbsc3103 faudzi
PPT
Building A City
PPS
Lorenzoysucazo
PPTX
TUGAS Kelompok 2
PPT
Thanksgiving day
PPTX
Arte en vivo
PDF
elective_marketing_aCipolla_3EMBAPT
PPT
Peoples and Empires
PPT
Puzzle - Orographic Precipitation
PPTX
La+NiñEz+..[1]
PDF
Salesforce DUG meetup #10 MiniHack完全制覇の旅
PPTX
Sistem pencernaan katak
PDF
Ashutosh rubber-pvt-ltd
PPTX
Storyboards
DOC
Edit usul fiqh 2 0506
PDF
Posting responses to discussion forums in moodle (for teachers)
PPSX
Aqidah ke 1
PDF
PwC's - Redefining finance's role in the digital-age
PDF
Ta'lil al-Ahkam dan Pembaruan Usul Fikih
Lempung
Power point hbsc3103 faudzi
Building A City
Lorenzoysucazo
TUGAS Kelompok 2
Thanksgiving day
Arte en vivo
elective_marketing_aCipolla_3EMBAPT
Peoples and Empires
Puzzle - Orographic Precipitation
La+NiñEz+..[1]
Salesforce DUG meetup #10 MiniHack完全制覇の旅
Sistem pencernaan katak
Ashutosh rubber-pvt-ltd
Storyboards
Edit usul fiqh 2 0506
Posting responses to discussion forums in moodle (for teachers)
Aqidah ke 1
PwC's - Redefining finance's role in the digital-age
Ta'lil al-Ahkam dan Pembaruan Usul Fikih
Ad

Similar to Jms using j boss (20)

PPT
test
PPT
test
PPT
test
PPT
test
PPT
test
PPT
test
PPT
test
PDF
Message Driven Beans (6)
PPTX
M messaging 1
PPTX
M messaging 2
PPTX
Mule jms queues
PPT
How to apply Messaging In Java in Enterprise
PPTX
Jms queue
PPTX
#8 (Java Message Service)
PPT
Java Messaging Services
PPT
test validation
PPT
Test DB user
PDF
Server-side JS with NodeJS
PPT
PPTX
Jms queues
test
test
test
test
test
test
test
Message Driven Beans (6)
M messaging 1
M messaging 2
Mule jms queues
How to apply Messaging In Java in Enterprise
Jms queue
#8 (Java Message Service)
Java Messaging Services
test validation
Test DB user
Server-side JS with NodeJS
Jms queues

More from Skillwise Group (20)

PPTX
Skillwise Consulting New updated
PPTX
Email Etiquette
PDF
Healthcare profile
PDF
Manufacturing courses
PDF
Retailing & logistics profile
PPTX
Skillwise orientation
PPTX
Overview- Skillwise Consulting
PPTX
Skillwise corporate presentation
PDF
Skillwise Profile
PDF
Skillwise Softskill Training Workshop
PDF
Skillwise Insurance profile
PDF
Skillwise Train and Hire Services
PDF
Skillwise Digital Technology
PDF
Skillwise Boot Camp Training
PDF
Skillwise Academy Profile
PPTX
Skillwise Overview
PPTX
SKILLWISE - OOPS CONCEPT
PPTX
Skillwise - Business writing
PPTX
PPTX
Skillwise cics part 1
Skillwise Consulting New updated
Email Etiquette
Healthcare profile
Manufacturing courses
Retailing & logistics profile
Skillwise orientation
Overview- Skillwise Consulting
Skillwise corporate presentation
Skillwise Profile
Skillwise Softskill Training Workshop
Skillwise Insurance profile
Skillwise Train and Hire Services
Skillwise Digital Technology
Skillwise Boot Camp Training
Skillwise Academy Profile
Skillwise Overview
SKILLWISE - OOPS CONCEPT
Skillwise - Business writing
Skillwise cics part 1

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Electronic commerce courselecture one. Pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
KodekX | Application Modernization Development
PPTX
Big Data Technologies - Introduction.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Machine learning based COVID-19 study performance prediction
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Cloud computing and distributed systems.
PPTX
Spectroscopy.pptx food analysis technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
MYSQL Presentation for SQL database connectivity
Electronic commerce courselecture one. Pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Weekly Chronicles - August'25 Week I
KodekX | Application Modernization Development
Big Data Technologies - Introduction.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Programs and apps: productivity, graphics, security and other tools
Machine learning based COVID-19 study performance prediction
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Cloud computing and distributed systems.
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf

Jms using j boss

  • 2. Table Of Contents 2  Introduction to JMS  JMS concepts  JMS API Architecture  JMS Application  JBossMQ  Getting started with JBossMQ
  • 3. Introduction to JMS • Java Message Services, JMS, is Sun's standard API for message queuing systems. • JMS provides a flexible and powerful API that encourages a fine-grained, modular distribution of functionality among application components. • Why use JMS? • JMS has two message protocols: point to point and publisher/subscriber instead of only one, as many earlier middleware systems. • Asynchronous Messaging 3
  • 4. Introduction to JMS (contd…) • Lose coupling, meaning reduced complexity as components depend less on each other. • Store-and-forward/Guaranteed delivery - Message is "held back" by the JMS provider in case receiver is not ready, and delivered as soon as the receiver is ready. • Quality of Service Enforcement - e.g. higher priority message delivered before low priority, drop old messages before they reach consumers etc. • Easy to learn programming model. 4
  • 5. JMS concepts • A JMS provider is a messaging system that implements JMS and • provides administrative and control features. • JMS clients are the programs or components, written in the Java, • that produce and consume messages. • Messages are the objects that communicate information between • JMS clients. • Administered objects are preconfigured JMS objects created by an • administrator for the use of clients. • Two kinds of administered objects are Destinations and • Connection Factories. 5
  • 6. Messaging Domains • Point-to-Point (PTP) • The Point-to-Point model calls the destination objects ‘queues’. • Each message has only one consumer. • Each queue can have multiple consumers. • A sender and receiver have no time dependencies. • The receiver acknowledges the successful processing of a message. • Use PTP when every message you send must be processed • successfully by one consumer. 6
  • 7. Messaging Domains (contd…) • Publish/Subscribe The Pub-Sub model, calls the destination objects ‘topics’. • Each message may have multiple consumers. • Publishers and subscribers have timing dependencies. • Publishers and subscribers are generally anonymous and the system takes care of distributing the messages. 7
  • 8. Message Consumption • Messages can be consumed in either of two ways: • Synchronously: A subscriber or a receiver explicitly fetches the message from the destination by calling the receive method. The receive method can block until a message arrives or can time out if a message does not arrive within a specified time. • Asynchronously: A client can register a message listener with a consumer. A message listener is similar to an event listener. Whenever a message arrives at the destination, the JMS provider delivers the message by calling the listener’s onMessage() method, which acts on the contents of the message. 8
  • 9. JMS API Architecture • 1: Bind destinations and connection factories objects. • 2. Client looks up for administered objects in the namespace. • 3. Establish a logical connection to the looked up object • through a JMS provider. 9
  • 10. The basic building blocks of a JMS application 10
  • 11. The basic building blocks of a JMS application (contd…) • Administered Objects: Connection Factories: A connection factory is the object a client uses to create a connection with a provider Destinations: A destination is the object a client uses to specify the target of messages it produces and the source of messages it consumes • Sessions: A session is a single-threaded context for producing and consuming messages. You use sessions to create message producers, message consumers, and messages. • Message Producers:A message producer is an object created by a session and is used for sending messages to a destination. 11
  • 12. The basic building blocks of a JMS application (contd…) • Message Consumers:A message consumer is an object created by a session and is used for receiving messages sent to a destination. • Messages • A JMS message has three parts: • A Header • Properties (optional) • A Body (optional) 12
  • 13. Basic Steps for writing a JMS application • Get the JNDI initial context. • Look up a connection factory (for the right type of destination, topic or queue). • Obtain a connection from the factory. • Create a session tied to the connection. • Look up the destination (topic or queue). • Create a message producer or a message consumer (specific for the topic or the queue). 13
  • 14. Basic Steps • 1) Get the JNDI initial context • Create a file named jndi.properties with the following lines: • Client jndi.properties file example: • java.naming.factory.initial=org.jnp.interfaces.NamingCont extFactory java.naming.provider.url=localhost:1099 java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.int erfaces • // Get the initial context • Context context = new InitialContext(); 14
  • 15. Basic Steps (contd…) • 2) Look up a connection factory • For Topic • TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup("ConnectionFactory"); • For Queue • QueueConnectionFactory queueFactory = (QueueConnectionFactory)context.lookup("Connec tionFactory"); 15
  • 16. Basic Steps (contd…) • 3) Obtain a connection from the factory • For Topic • TopicConnection topicConnection = topicFactory.createTopicConnection(); • • For Queue • QueueConnection queueConnection = • queueFactory.createQueueConnection(); 16
  • 17. Basic Steps (contd…) • 4) Create a session tied to the connection • For Topic • TopicSession topicSession = • topicConnection.createTopicSession(false, • Session.AUTO_ACKNOWLEDGE); • For Queue • QueueSession queueSession = • queueConnection.createQueueSession(false, • Session.AUTO_ACKNOWLEDGE); • 17
  • 18. Basic Steps (contd…) • 5) Look up the destination • For Topic • Topic topic = (Topic)context.lookup("topic/testTopic"); • For Queue • Queue queue = (Queue)context.lookup("queue/testQueue"); • Note: that in JBossMQ the prefix topic/ is always placed before • the topic name and the prefix queue/ is always placed before • the queue name. • 18
  • 19. Basic Steps (contd…) • 6) Create a message producer • For Topic create publisher • TopicPublisher topicPublisher = topicSession.createPublisher(topic); • For Queue create sender • QueueSender queueSender = queueSession.createSender(queue); 19
  • 20. Basic Steps (contd…) • 7) Create a TextMessage • For Topic create TextMessage and publish it • TextMessage message = topicSession.createTextMessage(); • message.setText(message); • topicPublisher.publish(topic, message); • For Queue create TextMessage and send it • TextMessage message = queueSession.createTextMessage(); • message.setText(message); • queueSender.send(queue, message); 20
  • 21. Basic Steps (contd…) • 8) Create a message consumer • For asynchronous receiving implement a Message Listener • interface. • public class HelloSubscriber implements MessageListener { • Create and start a topic subscriber • topicSubscriber = topicSession.createSubscriber(topic); • • // Set the message listener • topicSubscriber.setMessageListener(this); • topicConnection.start(); • • 21
  • 22. Basic Steps (contd…) • Create and start a queue receiver • queueReceiver = queueSession.createReceiver(queue); • // Set the message listener • queueReceiver.setMessageListener(this); • queueConnection.start(); 22
  • 23. JBossMQ • JBossMQ is composed of several services working together to provide JMS API level services to client applications. • JBoss-4.x supports the JMS1.1 version spec. • JBoss-3.2.x supports the JMS1.0.2b spec. • It Supports two messaging styles: • Queue: a message is received by only one client. • Topic: a message is “broadcast” to multiple client subscribers. 23
  • 24. Features of JBossMQ • Asynchronous delivery of messages. • Guaranteed delivery of message either by persisting the message or by redelivering it. • Multi protocol support. • Pluggable Security to support different security mechanisms. • Pluggable Persistence to support different persistence mechanisms. 24
  • 25. Configuring JMS with JBoss 1. Install the JMS service This is a JMS folder in the deploy directory with *-service.xml MBean configurations 2. JMS Topics and Queues are implemented as MBeans 3. DestinationManager MBean manages the destinations (queue and topic) 4. The jbossmq-destinations-service.xml defines some default queues and topics 5. To add a new Queue (or topic), add a new entry like this to this file ( or any *-service.xml file) – • <mbean code="org.jboss.mq.server.jmx.Queue" • name="jboss.mq.destination:service=Queue,name=MyQueu e"> • </mbean> • This will add a queue by name ‘queue/MyQueue’ 25
  • 26. Running the examples • For Topic 1) Start the Jboss Server. 2) Run the subscriber. 3) Run the publisher. • For Queue 1) Start the Jboss Server. 2) Run the sender. 3) Run the receiver. 26
  • 27. JBoss MQ – Exercise -1 • Configure the queues ‘queue/inputQueue’ and ‘queue/outputQueue’ to the JBoss Server • Write a program to send java expression strings to the queue. • For e.g., the program could send the following strings “int a=1”, “int b=5”, and “int c=a+b” . This program then waits on the output queue and print the result once it is available. • Write a program to receive java expressions from the input queue and evaluate the expression and send the result to the output queue. (Use bsh shell for Java Expression Evaluation) 27
  • 28. JBoss MQ – Exercise - 2 • Write a program to serialize an object and put it in a queue. • Write a program to receive serialized class files from a queue, de-serialize the object and execute methods on the object using Java reflection. 28
  • 29. JBoss MQ – Exercise - 3 • Explore persistent messages with JBossMQ • Explore users/roles with JBossMQ 29
  • 30. References • http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/basics.html • http://www.coredevelopers.net/library/jboss/jms-dev/j2ee-container.jsp • http://docs.jboss.org/jbossas/jboss4guide/r3/html/ • http://www.jboss.org/wiki/Wiki.jsp?page=JBossMQ 30