Connection to activemq broker is lost within one second

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

Connection to activemq broker is lost within one second

aragoubi
I have an embedded broker, and I am connection a Paho client to it.
This my broker config file :

  <broker xmlns="http://activemq.apache.org/schema/core" useJmx="true" useShutdownHook="false"  brokerName="mimo.broker1">

     <managementContext>
       
       <managementContext createConnector="false"/>
     </managementContext>
         
    <persistenceAdapter>
       <kahaDB directory="activemq-data/kahadb"/>
           
     </persistenceAdapter>

    <transportConnectors>
          <transportConnector name="ws+mqtt" uri="ws://0.0.0.0:1884?transport.useKeepAlive=true"/>           
    </transportConnectors>       
  </broker>

When I connect my apache paho to my broker, connection is established but lost within only one second.
I tried to connect instead to mosquito broker and connection is never lost.

Could someone help me with this ?


Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

tabish121@gmail.com
On 05/16/2017 11:12 AM, aragoubi wrote:

> I have an embedded broker, and I am connection a Paho client to it.
> This my broker config file :
>
>    <broker xmlns="http://activemq.apache.org/schema/core" useJmx="true"
> useShutdownHook="false"  brokerName="mimo.broker1">
>
>       <managementContext>
>        
>         <managementContext createConnector="false"/>
>       </managementContext>
>
>      <persistenceAdapter>
>         <kahaDB directory="activemq-data/kahadb"/>
>
>       </persistenceAdapter>
>
>      <transportConnectors>
>  <transportConnector name="ws+mqtt"
> uri="ws://0.0.0.0:1884?transport.useKeepAlive=true"/>
>      </transportConnectors>
>    </broker>
>
> When I connect my apache paho to my broker, connection is established but
> lost within only one second.
> I tried to connect instead to mosquito broker and connection is never lost.
>
> Could someone help me with this ?
>
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Connection-to-activemq-broker-is-lost-within-one-second-tp4726204.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

You need to provide enough information for people to be able to start to
help you.

What's the broker version?
What do the broker logs say?
Did you update the log configuration to produce more information?
What do the client logs say?


--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

aragoubi
I am using activemq 5.9.0.
My client is using mqtt v3.1.
I can't enable more log for my broker because I can't access my broker with jconsole in order to change th log4j.
There is no problem with my client because connection is established. He just told that connection is lost (callbacks).
I think that the problem is coming from the broker because connection is never lost when I try to connect to mosquito broker.

Here the other configuration files for my broker that I deployed in jboss:
In the ra.xml file I just changed vm://localhost by tcp://localhost:61616.

This is my ironjacamar.xml file:

<ironjacamar>
       
       
        <connection-definitions>
                <connection-definition
                        class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory"
                        jndi-name="java:jboss/jms/ActiveTopicConnectionFactory" pool-name="TopicConnectionFactory">
                        <pool>
                                <min-pool-size>1</min-pool-size>
                                <max-pool-size>200</max-pool-size>
                                <prefill>false</prefill>
                        </pool>
                        <security>
                                <application />
                        </security>
                        <timeout>                     
                                <blocking-timeout-millis>60000</blocking-timeout-millis> 
                                <idle-timeout-minutes>60</idle-timeout-minutes> 
                        </timeout>
                        <validation>
                                <background-validation>false</background-validation>
                                <use-fast-fail>false</use-fast-fail>
                        </validation>
                </connection-definition>
                <connection-definition
                        class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory"
                        jndi-name="java:jboss/jms/ActiveConnectionFactory" pool-name="QueueConnectionFactory">
                        <pool>
                                <min-pool-size>1</min-pool-size>
                                <max-pool-size>200</max-pool-size>
                                <prefill>false</prefill>
                        </pool>
                        <security>
                                <application />
                        </security>
                        <timeout>
                       
                                <blocking-timeout-millis>60000</blocking-timeout-millis>
                                <idle-timeout-minutes>60</idle-timeout-minutes> 
                               
                        </timeout>
                        <validation>
                                <background-validation>false</background-validation>
                                <use-fast-fail>false</use-fast-fail>
                        </validation>
                </connection-definition>
        </connection-definitions>
       
        <admin-objects>
                <admin-object class-name="org.apache.activemq.command.ActiveMQTopic"
                        jndi-name="java:jboss/jms/ActiveTestTopic">
                        <config-property name="PhysicalName">activemq/topic/TestTopic
                        </config-property>
                </admin-object>
                <admin-object class-name="org.apache.activemq.command.ActiveMQQueue"
                        jndi-name="java:jboss/jms/ActiveRequestQueue">
                        <config-property name="PhysicalName">activemq/queue/RequestQueue
                        </config-property>
                </admin-object>

                <admin-object class-name="org.apache.activemq.command.ActiveMQQueue"
                        jndi-name="java:jboss/jms/ActiveResponseQueue">
                        <config-property name="PhysicalName">activemq/queue/ResponseQueue
                        </config-property>
                </admin-object>
        </admin-objects>

</ironjacamar>
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

tabish121@gmail.com
On 05/16/2017 12:19 PM, aragoubi wrote:

> I am using activemq 5.9.0.
> My client is using mqtt v3.1.
> I can't enable more log for my broker because I can't access my broker with
> jconsole in order to change th log4j.
> There is no problem with my client because connection is established. He
> just told that connection is lost (callbacks).
> I think that the problem is coming from the broker because connection is
> never lost when I try to connect to mosquito broker.
>
> Here the other configuration files for my broker that I deployed in jboss:
> In the *ra.xml file* I just changed vm://localhost by tcp://localhost:61616.

There's been a number of fixes to the broker since 5.9.0 both for
WebSockets and for MQTT.  Having worked on the WS layer in versions past
even after 5.9.0 I'd say you should probably stay away from it unless
you move to a much newer release.  At the very least use the MQTT
transport and not go over WebSockets on that old release

> This is my *ironjacamar.xml* file:
>
> <ironjacamar>
>
>
> <connection-definitions>
> <connection-definition
> class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory"
> jndi-name="java:jboss/jms/ActiveTopicConnectionFactory"
> pool-name="TopicConnectionFactory">
> <pool>
> <min-pool-size>1</min-pool-size>
> <max-pool-size>200</max-pool-size>
> <prefill>false</prefill>
> </pool>
> <security>
> <application />
> </security>
> <timeout>
> <blocking-timeout-millis>60000</blocking-timeout-millis>
> <idle-timeout-minutes>60</idle-timeout-minutes>
> </timeout>
> <validation>
> <background-validation>false</background-validation>
> <use-fast-fail>false</use-fast-fail>
> </validation>
> </connection-definition>
> <connection-definition
> class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory"
> jndi-name="java:jboss/jms/ActiveConnectionFactory"
> pool-name="QueueConnectionFactory">
> <pool>
> <min-pool-size>1</min-pool-size>
> <max-pool-size>200</max-pool-size>
> <prefill>false</prefill>
> </pool>
> <security>
> <application />
> </security>
> <timeout>
>
> <blocking-timeout-millis>60000</blocking-timeout-millis>
> <idle-timeout-minutes>60</idle-timeout-minutes>
>
> </timeout>
> <validation>
> <background-validation>false</background-validation>
> <use-fast-fail>false</use-fast-fail>
> </validation>
> </connection-definition>
> </connection-definitions>
>
> <admin-objects>
> <admin-object class-name="org.apache.activemq.command.ActiveMQTopic"
> jndi-name="java:jboss/jms/ActiveTestTopic">
> <config-property name="PhysicalName">activemq/topic/TestTopic
> </config-property>
> </admin-object>
> <admin-object class-name="org.apache.activemq.command.ActiveMQQueue"
> jndi-name="java:jboss/jms/ActiveRequestQueue">
> <config-property name="PhysicalName">activemq/queue/RequestQueue
> </config-property>
> </admin-object>
>
> <admin-object class-name="org.apache.activemq.command.ActiveMQQueue"
> jndi-name="java:jboss/jms/ActiveResponseQueue">
> <config-property name="PhysicalName">activemq/queue/ResponseQueue
> </config-property>
> </admin-object>
> </admin-objects>
>
> </ironjacamar>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Connection-to-activemq-broker-is-lost-within-one-second-tp4726204p4726206.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

aragoubi
I upgraded to activemq 5.14.3, and I changed log level to debug.
Client still loosing connection just 1 second after connection.
Here is my server.log file :
server.log
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

Tim Bain
I know very little about MQTT (Tim Bish knows that code much better, so
it's good that he's been involved in this thread so far), but I notice the
following in the log you attached:

11:31:43,850 DEBUG
[org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection]
(qtp764114829-245) Filled 10 bytes -
DirectByteBuffer@2c84d353[p=0,l=10,c=4096,r=10]={<<<\x88\x84<\x1b6\x11\r+\x06!>>>MQTT\x04\xC0\x00\x1e\x00\nJavaSam...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
11:31:43,851 DEBUG [org.eclipse.jetty.websocket.common.Parser]
(qtp764114829-245) SERVER Parsing 10 bytes
11:31:43,852 DEBUG [org.eclipse.jetty.websocket.common.Parser]
(qtp764114829-245) SERVER OpCode CLOSE, fin=true rsv=...
11:31:43,853 DEBUG [org.eclipse.jetty.websocket.common.Parser]
(qtp764114829-245) SERVER Payload Length: 4 -
Parser@25d94d80[ExtensionStack,s=PAYLOAD_LEN,c=0,len=4,f=CLOSE[len=0,fin=true,rsv=...,masked=true],p=WebSocketPolicy@5d6f21e9[behavior=SERVER,maxTextMessageSize=65536,maxTextMessageBufferSize=32768,maxBinaryMessageSize=65536,maxBinaryMessageBufferSize=32768,asyncWriteTimeout=60000,idleTimeout=300000,inputBufferSize=4096]]

That block looks to me like the client requests that the connection be
closed, and the broker does as requested. I know you've said that your
client is not closing the connection (based primarily on the behavior
you see when connected to a non-ActiveMQ broker *using a different
underlying transport*), but I think it's time to re-evaluate that
assumption you've been making up to this point.

(The other) Tim


On May 17, 2017 4:28 AM, "aragoubi" <[hidden email]> wrote:

I upgraded to activemq 5.14.3, and I changed log level to debug.
Client still loosing connection just 1 second after connection.
Here is my server.log file :
server.log <http://activemq.2283324.n4.nabble.com/file/n4726230/server.log>



--
View this message in context: http://activemq.2283324.n4.
nabble.com/Connection-to-activemq-broker-is-lost-within-one-second-
tp4726204p4726230.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

aragoubi
No, I am not closing connection, this is the client code and the broker files(ra.xml, ironjacamar.xml, broker-config.xml):

client.txt

broker-config.xml
ironjacamar.xml
ra.xml
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

Tim Bain
Uh, what about this line? "sampleClient.disconnect();"

On May 17, 2017 7:30 AM, "aragoubi" <[hidden email]> wrote:

> No, I am not closing connection, this is the client code and the broker
> files(ra.xml, ironjacamar.xml, broker-config.xml):
>
> client.txt <http://activemq.2283324.n4.nabble.com/file/n4726245/client.txt
> >
>
> broker-config.xml
> <http://activemq.2283324.n4.nabble.com/file/n4726245/broker-config.xml>
> ironjacamar.xml
> <http://activemq.2283324.n4.nabble.com/file/n4726245/ironjacamar.xml>
> ra.xml <http://activemq.2283324.n4.nabble.com/file/n4726245/ra.xml>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Connection-to-activemq-broker-is-lost-within-one-second-
> tp4726204p4726245.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

aragoubi
This post was updated on .
This at the end of code, I am getting the problem just when I connect (IMqttToken token = sampleClient.connect(connOpts);).
When I debug, I stop just after the connection line. At first the connectComplete(boolean reconnect, String serverURI) method of the callback is invoked and just after a second the connectionLost(Throwable cause) is invoked.
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

MartinEden
Hi,

Related to what Ragoubi is experiencing, I posted a message a few days ago
with this title: *Experiencing constant reconnects with paho Java client
v1.1.1 and broker Active MQ 5.14.3.*

I am basically seeing constant reconnects for both MqttClient instances
(one subscriber and one publisher) used by my app.

Like in Ragounbi's case, the reconnects happen roughly every 1 sec as seen
below from both server and client logs. Unlike him I have set auto
reconnect for both clients. Unlike him I also have a long running app,
constantly reading data from the MQTT broker and publishing back on another
topic on the same broker.

I also tried the Mosquitto broker with the same behavior.

Can someone help figure this out?

Thanks,
M

P.S.

Detailed ActiveMQ and Mosquitto broker logs as well as Paho Java 1.1.1
client logs below.

Active MQ broker logs:
2017-04-27 21:44:48,487 | WARN  | Stealing link for clientId sub From
Connection Transport Connection to: tcp://192.168.99.1:61766 |
org.apache.activemq.broker.region.RegionBroker | ActiveMQ Transport:
tcp:///192.168.99.1:61768@1883
2017-04-27 21:44:48,832 | WARN  | Stealing link for clientId pub From
Connection Transport Connection to: tcp://192.168.99.1:61767 |
org.apache.activemq.broker.region.RegionBroker | ActiveMQ Transport:
tcp:///192.168.99.1:61769@1883
2017-04-27 21:44:49,497 | WARN  | Stealing link for clientId sub From
Connection Transport Connection to: tcp://192.168.99.1:61768 |
org.apache.activemq.broker.region.RegionBroker
...

Also tried with Mosquitto 1.4.10.
Broker logs:
1494930100: mosquitto version 1.4.10 (build date 2016-10-26 14:35:35+0000)
starting
1494930100: Config loaded from /mosquitto/config/mosquitto.conf.
1494930100: Opening ipv4 listen socket on port 1883.
1494930100: Opening ipv6 listen socket on port 1883.
1494930171: New connection from xxx.xxx.xxx.xxx on port 1883.
1494930171: New client connected from xxx.xxx.xxx.xxx as
paho1494930171596000000 (c0, k60).
1494930171: New connection from xxx.xxx.xxx.xxx on port 1883.
1494930171: New client connected from xxx.xxx.xxx.xxx as
paho1494930171987000000 (c1, k60).
1494930173: New connection from xxx.xxx.xxx.xxx on port 1883.
1494930173: New client connected from xxx.xxx.xxx.xxx as sub (c0, k60).
1494930175: New connection from xxx.xxx.xxx.xxx on port 1883.
1494930175: New client connected from xxx.xxx.xxx.xxx as pub (c0, k60).
1494930182: Socket error on client sub, disconnecting.
1494930183: New connection from xxx.xxx.xxx.xxx on port 1883.
1494930183: Client sub disconnected.
1494930183: New client connected from xxx.xxx.xxx.xxx as sub (c0, k60).
1494930184: Socket error on client sub, disconnecting.
1494930185: New connection from xxx.xxx.xxx.xxx on port 1883.
1494930185: Client sub disconnected.
1494930185: New client connected from xxx.xxx.xxx.xxx as sub (c0, k60).
1494930185: Socket error on client sub, disconnecting.
1494930186: New connection from xxx.xxx.xxx.xxx on port 1883.
1494930186: Client sub disconnected.
1494930186: New client connected from xxx.xxx.xxx.xxx as sub (c0, k60).
1494930187: Socket error on client sub, disconnecting.
1494930188: New connection from xxx.xxx.xxx.xxx on port 1883.
1494930188: Client sub disconnected.
1494930188: New client connected from xxx.xxx.xxx.xxx as sub (c0, k60).
1494930189: Socket error on client sub, disconnecting.
1494930190: New connection from xxx.xxx.xxx.xxx on port 1883.
1494930190: Client sub disconnected.
1494930190: New client connected from xxx.xxx.xxx.xxx as sub (c0, k60).
1494930190: New connection from xxx.xxx.xxx.xxx on port 1883.
1494930190: Client sub already connected, closing old connection.
1494930190: Client sub disconnected.
1494930190: New client connected from xxx.xxx.xxx.xxx as sub (c0, k60).
1494930190: New connection from xxx.xxx.xxx.xxx on port 1883.
1494930190: Client pub already connected, closing old connection.
1494930190: Client pub disconnected.
1494930190: New client connected from xxx.xxx.xxx.xxx as pub (c0, k60).
1494930191: New connection from xxx.xxx.xxx.xxx on port 1883.

On the client I see these errors every roughly 1 sec as well (if using both
brokers). Note using 2 paho MqttClient instances subscribed to the same
broker, one subscriber (with id sub) and one publisher with id (pub).
Both clients are set to auto reconnect.

App logs when running with ActiveMQ:
17/05/17 18:55:03,964 ERROR MQTTSource: Connection lost for MqttClient with
id [sub]; going to auto-reconnect
Connection lost (32109) - java.io.EOFException
at
org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:164)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)
at
org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:92)
at
org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:116)
... 1 more
17/05/17 18:55:03,976 ERROR MQTTSink: Connection lost for MqttClient with
id [pub]; going to auto-reconnect
Connection lost (32109) - java.io.EOFException
at
org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:164)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)
at
org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:92)
at
org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:116)
... 1 more
17/05/17 18:55:04,988 ERROR MQTTSource: Connection lost for MqttClient with
id [sub]; going to auto-reconnect
Connection lost (32109) - java.io.EOFException
at
org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:164)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)
at
org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:92)
at
org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:116)
... 1 more
17/05/17 18:55:04,995 ERROR MQTTSink: Connection lost for MqttClient with
id [pub]; going to auto-reconnect
Connection lost (32109) - java.io.EOFException
at
org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:164)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)
at
org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:92)
at
org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:116)
... 1 more

App logs when running with Mosquitto (just messages for pub showed below):
17/05/17 18:43:57,810 ERROR MQTTSink: Connection lost for MqttClient with
id [pub]; going to auto-reconnect
Connection lost (32109) - java.io.EOFException
        at
org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:164)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.EOFException
        at java.io.DataInputStream.readByte(DataInputStream.java:267)
        at
org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:92)
        at
org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:116)
        ... 1 more
17/05/17 18:43:58,816 ERROR MQTTSink: Connection lost for MqttClient with
id [pub]; going to auto-reconnect
Connection lost (32109) - java.io.EOFException
        at
org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:164)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.EOFException
        at java.io.DataInputStream.readByte(DataInputStream.java:267)
        at
org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:92)
        at
org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:116)
        ... 1 more

All the logs above are from different runs so don't try to match the time
stamps in between server and client logs, they are different.

On Wed, May 17, 2017 at 4:05 PM, aragoubi <[hidden email]> wrote:

> This at the end of code, I am getting the problem just when I connect
> (IMqttToken token = sampleClient.connect(connOpts);).
> When I debug, I stop just after the connection line, and first the
> connectComplete(boolean reconnect, String serverURI) method of the callback
> is invoked and just after a second the connectionLost(Throwable cause) is
> invoked.
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Connection-to-activemq-broker-is-lost-within-one-second-
> tp4726204p4726256.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

Morgan
MartinEden do you have the Inactivity Monitor running on both client and server for ActiveMq ?
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

MartinEden
Thanks Morgan,

In the end I figured out that the threads were killed and started by the
code on my side hence the constant retries.

Sorry for all the noise about this.

M

On Thu, May 18, 2017 at 4:51 PM, Morgan <[hidden email]> wrote:

> MartinEden do you have the Inactivity Monitor running on both client and
> server for ActiveMq ?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Connection-to-activemq-broker-is-lost-within-one-second-
> tp4726204p4726360.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

Tim Bain
Martin,

Can you please describe how you're able to tell that the threads are being
killed on your side (and what was killing them, if you were able to
determine that), so that Aragoubi (and future readers) can see if he's
seeing the same behavior?

Thanks,
Tim

On May 22, 2017 4:20 AM, "Martin Eden" <[hidden email]> wrote:

> Thanks Morgan,
>
> In the end I figured out that the threads were killed and started by the
> code on my side hence the constant retries.
>
> Sorry for all the noise about this.
>
> M
>
> On Thu, May 18, 2017 at 4:51 PM, Morgan <[hidden email]> wrote:
>
> > MartinEden do you have the Inactivity Monitor running on both client and
> > server for ActiveMq ?
> >
> >
> >
> > --
> > View this message in context: http://activemq.2283324.n4.
> > nabble.com/Connection-to-activemq-broker-is-lost-within-one-second-
> > tp4726204p4726360.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

aragoubi
Now it's working for me too Tim, I think it was a problem of activeMQ and apache paho version compatibility. Maybe this is why threads were being killed for me. Now I am using activeMQ 5.9.0 and apache paho 1.1.0 and it is working fine.
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

Tim Bain
So if I understand correctly, you downgraded your Paho version from 1.1.1
to 1.1.0 and left the ActiveMQ version and your client code unchanged, and
everything started working. Is that right?

On May 23, 2017 3:06 AM, "aragoubi" <[hidden email]> wrote:

> Now it's working for me too Tim, I think it was a problem of activeMQ and
> apache paho version compatibility. Maybe this is why threads were being
> killed for me. Now I am using activeMQ 5.9.0 and apache paho 1.1.0 and it
> is
> working fine.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Connection-to-activemq-broker-is-lost-within-one-second-
> tp4726204p4726438.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

aragoubi
Also I am connecting the client to the "ws://0.0.0.0:1883" port instead of the "ws://0.0.0.0:61615" port.
But even like this, with activemq 5.14.3 I still have the same problem "client disconnecting in one second".
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

Tim Bain
That feels to me like there might still be something wrong in your
configuration, and maybe it only works with those two older versions of
ActiveMQ and Paho because they don't include the code that would recognize
that something's not right. I'd like to see what if anything Martin can
tell us about how he figured out what was wrong in his code, in the hopes
that that might lead you to something that would be useful for you as well,
so hopefully he'll respond when he can.

Tim

On Tue, May 23, 2017 at 6:44 AM, aragoubi <[hidden email]> wrote:

> Also I am connecting the client to the "ws://0.0.0.0:1883" port instead of
> the "ws://0.0.0.0:61615" port.
> But even like this, with activemq 5.14.3 I still have the same problem
> "client disconnecting in one second".
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Connection-to-activemq-broker-is-lost-within-one-second-
> tp4726204p4726442.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Connection to activemq broker is lost within one second

MartinEden
Hi,

On my side. I was doing an integration test as I said earlier. As part of
the integration test I was injecting a fault in the framework I am running
the app within. Again my app is just reading from an MQTT topic, doing some
processing and writing out in another topic. It turned out that as part of
the recovery from the fault the MQTT client was not shut down properly so
there were dangling threads left around. When the app was restarted it
allocated new clients with the same ids as the ones that were still
dangling and hence the constant retries and churning of threads. All on my
side, nothing to do with ActiveMQ.

Thanks,
M

On Wed, May 24, 2017 at 7:27 AM, Tim Bain <[hidden email]> wrote:

> That feels to me like there might still be something wrong in your
> configuration, and maybe it only works with those two older versions of
> ActiveMQ and Paho because they don't include the code that would recognize
> that something's not right. I'd like to see what if anything Martin can
> tell us about how he figured out what was wrong in his code, in the hopes
> that that might lead you to something that would be useful for you as well,
> so hopefully he'll respond when he can.
>
> Tim
>
> On Tue, May 23, 2017 at 6:44 AM, aragoubi <[hidden email]> wrote:
>
> > Also I am connecting the client to the "ws://0.0.0.0:1883" port instead
> of
> > the "ws://0.0.0.0:61615" port.
> > But even like this, with activemq 5.14.3 I still have the same problem
> > "client disconnecting in one second".
> >
> >
> >
> > --
> > View this message in context: http://activemq.2283324.n4.
> > nabble.com/Connection-to-activemq-broker-is-lost-within-one-second-
> > tp4726204p4726442.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>