activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sreekar <>
Subject Re: Can we connect multiple connection for the same destination ?
Date Thu, 19 Apr 2012 10:10:08 GMT
Hi Mickhayes,

> I think that if you draw the picture for what you have described, you will
> see that you are trying to share > a JMS Connection CX between your
> producing process (JMS client) SSX and a different consuming process > SRX
> (a different JMS Client).

> Process SS1 cannot have the the same JMS Connection C1 as a different
> process SR1.

> I think you might be proposing using a single Queue Destination to pass
> messages from each SSX to its 
> counterpart SRX, with each consumer only getting the messages produced by
> its counterpart producer.

> Can you clarify if this is what you are trying to achieve?

*Yes, this is exactly what i intend to achieve.*

We have a simple API to read the message
*read_queue (queue_handle, ack_mode, char* msg_holder);*
*queue_handle* : mapping which stores the connection_info, session_info,
*ack_mode*      : whether using session_transacted or not
*msg_holder*    :  holds the message read from the queue

The above API can be called from any other application process.
((which stores the queue [[connection]] handle information ))

My doubt when i use the same connection handle.........same connection, same
session (opened in same mode [with which producer sent messages])....*will i
get only those messages (messages sent using that particular session* ?

I have 2 producers P1 & P2.

Scenario 1 :
P1 and P2 are created from connections C1 and C2, which pumps messages to
same QUEUE.
Conn1 stores info of (C1, sesion1, session1_mode, destination,
P1).......when i create a consumer using session1 (in session1_mode)
........will i get only the messages sent by P1 ? or is there a chance to
receive messages sent by P2 (other connection) as well ?

Scenario 2 :
P1 and P2 are created using the same connection, same session.

P1 created with session in AUTO_ACK Mode.
P2 created with session in SESSION_TRANSACTED Mode.

When i create the corresponding consumers, will they receive the messages
sent by the  corresponding producers ?

Hope i made my self clear.

> Note the first Anti-Pattern, the "Single-Purpose Queue" in the O'Reilly
> JMS book, 2ed in Chapter 11 
> "Messaging Design Considerations." 

I have read the above section.
The code which we are (were) using is a Legacy one and i am trying to
replace the queue mechanism for IPC with Active MQ.

Creating a separate Queue for each process will be very good idea, but my
architect wanted to explore all the options available.

Thanks for the response.

Please let me know your comments.

Thanks & Regards,

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message