Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 66BD510F15 for ; Thu, 6 Jun 2013 14:27:22 +0000 (UTC) Received: (qmail 74539 invoked by uid 500); 6 Jun 2013 14:27:22 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 74370 invoked by uid 500); 6 Jun 2013 14:27:21 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 74356 invoked by uid 99); 6 Jun 2013 14:27:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jun 2013 14:27:20 +0000 Date: Thu, 6 Jun 2013 14:27:19 +0000 (UTC) From: "Pedro Marques (JIRA)" To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AMQ-4576) MQTT BlockingConnection.receive fails when subscribing multiple topics MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Pedro Marques created AMQ-4576: ---------------------------------- Summary: MQTT BlockingConnection.receive fails when subscribing multiple topics Key: AMQ-4576 URL: https://issues.apache.org/jira/browse/AMQ-4576 Project: ActiveMQ Issue Type: Bug Affects Versions: 5.9.0 Reporter: Pedro Marques When more than one topic is supplied to BlockingConnection.subscribe the BlockingConnection.receive fails and the following exception is thrown: {code} java.io.IOException: Could not connect: CONNECTION_REFUSED_SERVER_UNAVAILABLE at org.fusesource.mqtt.client.CallbackConnection$LoginHandler$1.onTransportCommand(CallbackConnection.java:331) at org.fusesource.hawtdispatch.transport.TcpTransport.drainInbound(TcpTransport.java:659) at org.fusesource.hawtdispatch.transport.SslTransport.drainInbound(SslTransport.java:264) at org.fusesource.hawtdispatch.transport.TcpTransport$6.run(TcpTransport.java:538) at org.fusesource.hawtdispatch.internal.NioDispatchSource$3.run(NioDispatchSource.java:209) at org.fusesource.hawtdispatch.internal.SerialDispatchQueue.run(SerialDispatchQueue.java:100) at org.fusesource.hawtdispatch.internal.pool.SimpleThread.run(SimpleThread.java:77) {code} Code example: {code} MQTT = new MQTT(); mqtt.setHost(url); mqtt.setClientId(clientId); mqtt.setUserName(user); mqtt.setPassword(password); mqtt.setCleanSession(false); BlockingConnection connection = mqtt.blockingConnection(); connection.connect(); Topic[] topics = {new Topic("TopicA", QoS.EXACTLY_ONCE), new Topic("TopicB", QoS.EXACTLY_ONCE)}; byte[] qoses = connection.subscribe(topics); while (true) { Message message = connection.receive(); byte[] payload = message.getPayload(); String messageContent = new String(payload); System.out.println("Received message from topic: " + message.getTopic() + " Message content: " + messageContent); message.ack(); } {code} The test failed when using the current fusesource client (1.5) on ActiveMQ 5.9, on Mosquitto mqtt the code works correctly. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira