Reputation: 620
I am trying to build a push notification service using MQTT protocol (V3.1) and IBM MQ (8.0.0.0) broker running on suse linux, however, I faced with a problem. I wrote a simple java program to test concurrent connections number in IBM MQ. It simply starts to instantiate MqttClient and connect each of them to the remote IBM MQ broker.
public MyConsumer(String topic) throws MqttException{
this.client = new MqttClient(SERVER_ADDRESS, MqttClient.generateClientId(), new MemoryPersistence());
client.setCallback(new MyCallback());
MqttConnectOptions connectOptions = new MqttConnectOptions();
connectOptions.setMqttVersion(MqttConnectOptions.MQTT_VERSION_3_1);
connectOptions.setCleanSession(false);
try
{
if (!this.client.isConnected())
{
this.client.connect(connectOptions);
this.client.subscribe(topic);
}
}
catch (Exception e)
{
System.out.println("****** error ******");
e.printStackTrace();
}
}
The strange thing is that I got "Connection lost (32109) - java.io. EOFException" exception after around 870 clients had successfully connected to the broker:
Connection lost (32109) - java.io.EOFException
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:146)
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:65)
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:107)
... 1 more
I ran the test program in two different computers simultaneously to be sure that the problem is not related the testing computer. Also, I defined two telemetry channels in a queue manager, each deploy on different port, but the total clients connected to the broker was still around 870! Finally, I created two queue managers and under this circumstance the client connections doubled in number. I checked the mqxr log, but there was no error log. Can anybody give me any clue that why each queue manger only accepts this number connection.
P.S: might be helpful to mention that I test this sample with emqtt broker (another mqtt broker) and it works perfectly (with more than 5k connections)
Upvotes: 2
Views: 342
Reputation: 7506
push notification service using MQTT protocol (V3.1) and IBM MQ (8.0.0.0) broker
First off, why aren't you using MQTT protocol v3.1.1?
Secondly, stop using version '0' of the product. Upgrade immediately to MQ v8.0.0.10 or better MQ v9.0.0.4.
Finally, how many client applications (processes) are you running to create the 870 connections?
Upvotes: 0