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 440AC1043E for ; Tue, 27 Aug 2013 06:06:03 +0000 (UTC) Received: (qmail 23176 invoked by uid 500); 27 Aug 2013 06:06:03 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 22306 invoked by uid 500); 27 Aug 2013 06:05:55 -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 22188 invoked by uid 99); 27 Aug 2013 06:05:53 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Aug 2013 06:05:53 +0000 Date: Tue, 27 Aug 2013 06:05:53 +0000 (UTC) From: "greywolf (JIRA)" To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AMQ-4692) ActiveMQ broker does not publish last will messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 greywolf created AMQ-4692: ----------------------------- Summary: ActiveMQ broker does not publish last will messages Key: AMQ-4692 URL: https://issues.apache.org/jira/browse/AMQ-4692 Project: ActiveMQ Issue Type: Bug Components: Broker, MQTT Affects Versions: 5.8.0 Environment: win7 64 OS. Reporter: greywolf When I run a MQTT client=EF=BC=88paho or fuse=EF=BC=89to connect ActiveMQ b= roker. if i terminate this client and can not receive LWT messages from bro= ker. I changed broker from ActiveMQ to Mosquitto broker , everything is ok. below is my test class: package com.paho; import org.eclipse.paho.client.mqttv3.MqttCallback; import org.eclipse.paho.client.mqttv3.MqttClient; import org.eclipse.paho.client.mqttv3.MqttConnectOptions; import org.eclipse.paho.client.mqttv3.MqttDeliveryToken; import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttMessage; import org.eclipse.paho.client.mqttv3.MqttSecurityException; import org.eclipse.paho.client.mqttv3.MqttTopic; public class Sub { =09private MqttClient mqttClient; =09 =09public void subscriber(){ =09=09try { =09=09=09mqttClient =3D new MqttClient("tcp://192.168.100.80:1883", MqttCli= ent.generateClientId()); =09=09=09 =09=09=09MqttConnectOptions connectOptions =3D new MqttConnectOptions(); =09=09=09//set will =09=09=09connectOptions.setWill(mqttClient.getTopic("lastwill"), new String= ("I am offline").getBytes(), 1, false); =09=09=09mqttClient.connect(connectOptions); =09=09=09mqttClient.setCallback(new MqttCallback(){ =09=09=09=09public void connectionLost(Throwable paramThrowable) { =09=09=09=09=09System.out.println("Connection Exist. \nCause: " + paramThro= wable); =09=09=09=09=09while(true){ =09=09=09=09=09=09try { =09=09=09=09=09=09=09Thread.sleep(20000); =09=09=09=09=09=09=09if(!mqttClient.isConnected()){ =09=09=09=09=09=09=09=09subscriber(); =09=09=09=09=09=09=09} =09=09=09=09=09=09} catch (InterruptedException e) { =09=09=09=09=09=09=09e.printStackTrace(); =09=09=09=09=09=09} =09=09=09=09=09} =09=09=09=09} =09=09=09=09public void messageArrived(MqttTopic paramMqttTopic, =09=09=09=09=09=09MqttMessage paramMqttMessage) throws Exception { =09=09=09=09=09System.out.println("Message arrived From The Topic:\t"+param= MqttTopic.toString() +" \nMessage: " + paramMqttMessage.toString()); =09=09=09=09} =09=09=09=09public void deliveryComplete( =09=09=09=09=09=09MqttDeliveryToken paramMqttDeliveryToken) { =09=09=09=09} =09=09=09=09 =09=09=09}); =09=09=09 =09=09=09mqttClient.subscribe("durable",1); //=09=09=09mqttClient.subscribe("durable1",1); =09=09=09 =09=09} catch (MqttException e) { =09=09=09e.printStackTrace(); =09=09} =09} =09 =09/** =09 * @param args =09 */ =09public static void main(String[] args) { =09=09Sub sub =3D new Sub(); =09=09sub.subscriber(); =09} } -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira