This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Basic JMS Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Basic JMS Question" Watch "Basic JMS Question" New topic
Author

Basic JMS Question

Khaled Mahmoud
Ranch Hand

Joined: Jul 15, 2006
Posts: 361
Hi all,

I am still new to JMS and I want to ask about how the JMS provider distinguishes between clients. For example, a Queue JMS object is for sending for messages between two clients [Producer and Subscriber]. How each client is identified ??? Is it through the Connection factory object it uses.

Thanks


SCJP, SCJD,SCWCD,SCDJWS,SCEA 5 MCP-C#, MCP-ASP.NET - http://www.khaledinho.com/
Life is the biggest school
Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159
Hi Kahled...

By looking at the code, you can get who is Sender and Receiver.

onMessage() is the method to receive messages. So he is the receiver.

Provided both should follow all the steps to send or receive messages.

I mean getting connectionfactory object. Getting the Queue Jndi and all.


SCJP 1.4 & 1.5, SCWCD 1.5. Learn and Let Learn.
Khaled Mahmoud
Ranch Hand

Joined: Jul 15, 2006
Posts: 361
Thats' not what I mean. I mean JMS is for sending and exchanging of message between applications. Every application can be [once a consumer and once a sender]. Logically, every application has to identify itsself. For example, Khaled application is different from Jetendra application. When an application creates a connection a queue objects, how will the application provider know that this is either Khaled or Jetendra .

Thanks in advance.
Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159
bit confusing Khaled...

Did not get you?
Khaled Mahmoud
Ranch Hand

Joined: Jul 15, 2006
Posts: 361
Typically an application server administrator creates a Queue object. The purpose of this queue object is exchanging of messages between two applications. Right ?? How does an application access this queue object ??
It gets Connection Factory object through dependency injection and then creates a connection and a session then message production or consumer.

Let's say two applications will be using this Queue, Application one and application two. Application one is running and wants to send messages to this queue. How will the JMS provider distinguish between the two applications using the queue. Some sort of identification should occcur when an application connects to a queue. My question is how is this done.
Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159
With Connection Factory Jndi name. and the URL to connect to the Queue.

Will differentiate this. I believe this is what you are looking for.
Khaled Mahmoud
Ranch Hand

Joined: Jul 15, 2006
Posts: 361
Yes. This what I was looking for. Many thanks.
 
GeeCON Prague 2014
 
subject: Basic JMS Question