SwiftMQ and lookup call
1 posts in topic
Flat View  Flat View

Posted By:   Hamideh_Mostafavi
Posted On:   Friday, February 1, 2002 01:28 PM

I have a problem with programming JMS and SwiftMQ.
There is a function call:

obj = jndiContext.lookup(name);

to find a Queue object of a SwiftMQ provider each time we transmit a message using SwiftMQ. I wished to find
all the objects (for all the SwiftMQ server queues) at the initialization time of our application and use them when
sending each message. I mean to make the performance of our code better, I tried not to call this lookup method
at run time, but it does not work. No exception, but the message is not transmitted.
Do you have any idea why?

Thank you.

Re: SwiftMQ and lookup call

Posted By:   Nicholas_Whitehead  
Posted On:   Saturday, February 2, 2002 05:30 AM


As I understand it, you are attempting to pre-lookup all the Queue objects in JNDI before you start running, so you isssue a series of lookup(name) calls to retrieve the Queue objects. However, when you actually attempt to use the the queue objects that you retrieved, you believe that no messages are sent.

What you are trying to do seems ok, but lets just add a little detail.

  • Did you retrieve a QueueConnectionFactory from JNDI ?

    QueueConnectionFactory qcf = (QueueConnectionFactory)jndiContext.lookup(name);

  • Did you create a QueueConnection ?

    QueueConnection connection = qcf.createQueueConnection();

  • Did you create a QueueSession ?

    QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

  • Did you create a QueueSender using the Queue you retrieved from JNDI ?

    QueueSender sender = session.createSender(queueFromJNDI);

  • Did you use the sender to send the messages ?

If all these are more or less right, post your code and let't take a look.

About | Sitemap | Contact