From users-return-30576-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Mon Apr 2 12:42:39 2012 Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 956E092D2 for ; Mon, 2 Apr 2012 12:42:39 +0000 (UTC) Received: (qmail 56895 invoked by uid 500); 2 Apr 2012 12:42:39 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 56851 invoked by uid 500); 2 Apr 2012 12:42:39 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 56838 invoked by uid 99); 2 Apr 2012 12:42:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2012 12:42:39 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 216.139.250.139 is neither permitted nor denied by domain of trondarild.tobiassen@gmail.com) Received: from [216.139.250.139] (HELO joe.nabble.com) (216.139.250.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2012 12:42:32 +0000 Received: from [192.168.236.139] (helo=joe.nabble.com) by joe.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1SEgaJ-0004zQ-GG for users@activemq.apache.org; Mon, 02 Apr 2012 05:42:11 -0700 Date: Mon, 2 Apr 2012 05:42:11 -0700 (PDT) From: rogerroger To: users@activemq.apache.org Message-ID: <1333370531491-4525904.post@n4.nabble.com> In-Reply-To: References: <1333317294922-4524534.post@n4.nabble.com> Subject: Re: onmessage not picking up messages MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Param 'DestinationName' on the message I send(find it in JMX) has ActiveMQ.Advisory.TempTopic and TempQueue, not MyQueue. It is listed under Subscription.Non-Durable.Topic... I am using this code to produce the message(Can you see why it isn't published on MyTopic?): String message = "test message"; Session session = getSession(getQueueConnection()); TextMessage textMessage = session.createTextMessage(); textMessage.setText("Sending to queue: "+message); getProducer(session, "openejb:Resource/MyQueue").send(textMessage); System.out.println("Queue Message w/ id:"+textMessage.getJMSMessageID()+" sent"); private Context envContext = null; private Context getEnvContext() throws NamingException { if (envContext == null) { envContext = new InitialContext(); // envContext = (Context) initCtx.lookup("java:comp/env"); } return envContext; } private ConnectionFactory connectionFactory; private TopicConnection getTopicConnection() throws NamingException, JMSException { if (connectionFactory == null) { connectionFactory = (ConnectionFactory) getEnvContext().lookup( "openejb:Resource/MyJmsConnectionFactory"); } return (TopicConnection) connectionFactory.createConnection(); } private QueueConnection getQueueConnection() throws NamingException, JMSException { if (connectionFactory == null) { connectionFactory = (ConnectionFactory) getEnvContext().lookup( "openejb:Resource/MyJmsConnectionFactory"); } return (QueueConnection) connectionFactory.createConnection(); } private MessageProducer getProducer(Session session, String topicOrQueue) throws NamingException, JMSException { MessageProducer producer = session .createProducer((Destination) getEnvContext().lookup( topicOrQueue)); return producer; } private Session getSession(Connection connection) throws JMSException { return connection.createSession(false, Session.AUTO_ACKNOWLEDGE); } and this in openejb.xml: BrokerXmlConfig = broker:(tcp://localhost:61616) ServerUrl = tcp://localhost:61616 ResourceAdapter = MyJmsResourceAdapter ResourceAdapter = MyJmsResourceAdapter Torsten Mielke-2 wrote > > Hi, > > Check using jconsole that a consumer is registered on the destination that > you want to consume from. > If its not registered, then there is most likely a problem with your > consumer code. > > > Hope this serves as a starting point. > > > Torsten Mielke > torsten@ > tmielke@ > > > On Apr 1, 2012, at 11:54 PM, rogerroger wrote: > >> Hi >> >> I am using tomee plus and it's active mq version. I have started a >> broker, >> verified by 'telnet localhost 61616' and added topic and connection >> factory >> using openejb.xml resource elements. I am able to send messages to the >> broker, verified with the jConsole, but none are consumed. The same code >> worked using tomcat 7.11 and active mc core jar 5.5.1. I am starting up >> the >> consumers using a servlet listener. Yes, I have remembered the >> connection.start() and there is only one consumer in the code. >> >> Help is appreciated. >> >> >> >> -- >> View this message in context: >> http://activemq.2283324.n4.nabble.com/onmessage-not-picking-up-messages-tp4524534p4524534.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. > -- View this message in context: http://activemq.2283324.n4.nabble.com/onmessage-not-picking-up-messages-tp4524534p4525904.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.