Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » Regarding Rabbitmq with Mqtt Client Connection Failure(JAVA paho client to connect Rabbitmq using tcp connection)
Regarding Rabbitmq with Mqtt Client Connection Failure [message #1748916] Wed, 30 November 2016 06:50
Hardik lotiya is currently offline Hardik lotiyaFriend
Messages: 1
Registered: November 2016
Junior Member
I am using RabbitMq 3.6.6 with paho MqttClient version

am trying to connect on Demand Connection with RabbitMq Server using this client.

code look like

public static void main(String[] args){

String broker = "tcp://localhost:1883";
String clientId = "JavaSample";
MemoryPersistence persistence = new MemoryPersistence();
try {int i =0;
MqttClient sampleClient = new MqttClient(broker, clientId+i, persistence);
MqttConnectOptions connOpts = new MqttConnectOptions();
System.out.println("Connecting to broker: "+broker);
System.out.println("Connected "+i);
if(i%100 == 0){
System.gc ();
System.runFinalization ();
} catch(MqttException me) {
System.out.println("reason "+me.getReasonCode());
System.out.println("msg "+me.getMessage());
System.out.println("loc "+me.getLocalizedMessage());
System.out.println("cause "+me.getCause());
System.out.println("excep "+me);

here clientId is diff for each connection, I want to connection on Demand
for this I tries to decrease stack size in 'eclipse.ini' file

In RabbitMq some update configuration ln 'rabbitmq.config' file

{vm_memory_high_watermark, {absolute, "5000M"}}

update high watermark memory because when upto 3k connection this memory is near about full.
for this update rabbitmq.config file and reduce tcp sending buffer and receiving buffer so this issue resolved.

and also update free size like

{disk_free_limit, "2GB"}

I am getting Exception like...........

Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.start(
at org.eclipse.paho.client.mqttv3.internal.ClientComms.connect(
at org.eclipse.paho.client.mqttv3.internal.ConnectActionListener.connect(
at org.eclipse.paho.client.mqttv3.MqttAsyncClient.connect(
at org.eclipse.paho.client.mqttv3.MqttClient.connect(
at MQTTMaxConcurrentConnections.main(

Any Idea how to resolve and get up 50000 connection?

Previous Topic:JS client subscribes multiple topic
Next Topic:MQTTPacket C support for MQTT 3.1.1
Goto Forum:

Current Time: Mon Oct 26 20:00:58 GMT 2020

Powered by FUDForum. Page generated in 0.01546 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top