Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 5515 invoked from network); 30 Dec 2007 10:44:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Dec 2007 10:44:39 -0000 Received: (qmail 90097 invoked by uid 500); 30 Dec 2007 10:44:27 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 90067 invoked by uid 500); 30 Dec 2007 10:44:27 -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 90058 invoked by uid 99); 30 Dec 2007 10:44:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Dec 2007 02:44:27 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Dec 2007 10:44:04 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1J8veK-0002zQ-5f for users@activemq.apache.org; Sun, 30 Dec 2007 02:44:08 -0800 Message-ID: <14546105.post@talk.nabble.com> Date: Sun, 30 Dec 2007 02:44:08 -0800 (PST) From: pcdinh To: users@activemq.apache.org Subject: Can not receive MapMessage in ActiveMQ 5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: pcdinh@gmail.com X-Virus-Checked: Checked by ClamAV on apache.org ActiveMQ 5.0's QueueReceiver seems to have problems with MapMessage. It always returns bull object when the timeout occurs or waits in a countless time. Receiver code QueueConnectionFactory connFactory = new ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_BROKER_URL); QueueConnection conn = connFactory.createQueueConnection(); // This session is not transacted, and it uses automatic objectMessage acknowledgement QueueSession session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE); // create destination queue = session.createQueue("TestQueue"); QueueReceiver receiver = session.createReceiver(queue); MapMessage message = (MapMessage) receiver.receive(8000); if (message instanceof MapMessage) { int age = message.getInt("age"); float weight = message.getFloat("weight"); String name = message.getString("name"); String height = message.getObject("height").toString(); ............ } else { System.out.println("Timeout!!!!!"); } Sender code QueueConnectionFactory connFactory = new ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_BROKER_URL); QueueConnection conn = connFactory.createQueueConnection(); QueueSession session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE); queue = session.createQueue("TestQueue"); QueueSender sender = session.createSender(queue); MapMessage mapMessage = session.createMapMessage(); mapMessage.setInt("age", 88); mapMessage.setFloat("weight", 234); mapMessage.setString("name", "Smith"); mapMessage.setObject("height", new Double(150.32)); System.out.println("Sending the object message: " + mapMessage.toString()); sender.send(mapMessage); Sender run smoothly because I checked its message in queue with ActiveMQ's web console and see the message there. But when I run the receiver to get the message, it does not work. ActiveMQ works fine with TextMessage. I dont know if there is anything wrong with ActiveMQ 5. I would be grateful if someone could point me the right direction -- View this message in context: http://www.nabble.com/Can-not-receive-MapMessage-in-ActiveMQ-5.0-tp14546105s2354p14546105.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.