qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oggie <gog...@gmail.com>
Subject Re: java broker with jms and point to point
Date Thu, 27 Sep 2012 13:28:22 GMT
Thanks Robbie, I appreciate it.  The address change was the problem. I used
'amq.direct/shiftqueue' and it worked.

I'll look into making the changes to JNDI at some point in the future. 

I now have data going into the correct queue without a consumer connected.

But once I connect my consumer, it creates the temp queues instead of
connecting to the shiftqueue.  Not sure why it's behaving that way either... 

It's a message listener:


public final class CPEMessageListener implements MessageListener {
    @Override
    public void onMessage(final Message message) {
        try {
            BytesMessage bytesMessage = (BytesMessage) message;
            byte[] data = new byte[(int) bytesMessage.getBodyLength()];
            bytesMessage.readBytes(data);
            logger.debug("Consumed message: " + data.toString());
        } catch (JMSException e) {
            logger.error(e);
            //TODO - we need to handle the error and determine if we should
exit or keep running.
        }
    }
}


My spring config:



    <bean id="connectionFactory"
class="org.apache.qpid.client.AMQConnectionFactory">
        <constructor-arg index="0"
                        
value="amqp://admin:admin@clientid/shift?brokerlist='tcp://localhost:5672'"
/>
    </bean>

    
    <bean id="messageListener" class="com.blah.CPEMessageListener">
    </bean>

      
    <jms:listener-container concurrency="5-10" acknowledge="client">
        <jms:listener destination="amq.direct/shiftqueue"
ref="messageListener"/>
    </jms:listener-container>

    
    <bean id="cachedConnectionFactory"
         
class="org.springframework.jms.connection.CachingConnectionFactory"
          p:targetConnectionFactory-ref="connectionFactory"
          p:sessionCacheSize="1" />

    
    <bean id="destination"
          class="org.apache.qpid.client.AMQAnyDestination">
        <constructor-arg value="amq.direct/shiftqueue" />
    </bean>


Not sure why it doesn't connect to the shiftqueue. 





--
View this message in context: http://qpid.2158936.n2.nabble.com/java-broker-with-jms-and-point-to-point-tp7582591p7582677.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message