Title: Using a Message Driven Bean to put in another Queue does not work with 1.5.2 / OC4J
There is a serious problem in queueconnections in orion.  If you try to obtain queueconnection in MDB you will run into some kind of deadlocks.  I am not even sure what is the behaviour of this It gave me the exactly same problem when I tried to implement.
 
The alternate to this is write a Session Bean for submitting messages to queue.  I wrote a SessionBean which just submits given message to specified queue.  You can write all queueconnection and queue lookups in ejbCreate of the session bean.
 
Kesav Kumar
 
 
----- Original Message -----
Sent: Tuesday, November 13, 2001 3:20 PM
Subject: Using a Message Driven Bean to put in another Queue does not work with 1.5.2 / OC4J

We have a MDB that processes messages, we need it to put the results in ANOTHER queue.

This does not work right now, as per a couple of examples I found on the web this is what we are trying

    public void ejbCreate() throws EJBException, CreateException
    {
        try
        {
            InitialContext context = new InitialContext();

            QueueConnectionFactory conFactory = ( QueueConnectionFactory )context.lookup( CONNECTION_FACTORY );
            // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            // Create a JMS connection
            this.connection = conFactory.createQueueConnection();
            // Create a JMS session object
            this.session = connection.createQueueSession( false, Session.AUTO_ACKNOWLEDGE );
            // Start the connection so we can use it
            this.connection.start();
            // Lookup a JMS queue      
            this.searchResultsQueue = ( Queue )context.lookup( QUEUE_NAME );
            // Create a JMS sender
            this.sender = session.createSender( this.searchResultsQueue );

        }
        catch ( Exception e )
        {
            // error is logged by our logging service
        }

the line that looks up the connection factory fails
if we move this to onMessage() it works, where should this go to avoid creating this on EVERY message.

ejbCreate() is the "CORRECT" place as per all the examples and everything else.

Jarrod Roberson


Reply via email to