java.io.EOFException with paho

后端 未结 7 1446
慢半拍i
慢半拍i 2021-02-09 11:23

i want to make stress test on mosquitto, so i create some code as below

for (int i = 0; i < 800; i++) {
        final int j = i;
        Thread t = new Thread         


        
相关标签:
7条回答
  • 2021-02-09 12:00

    Sometimes it happen when you will try to send large data set. Try to decrease dataset size. It solved problem in my case.

    0 讨论(0)
  • 2021-02-09 12:05

    There's a 1024 files/sockets limit in linux but you can upset it,ulimit -n 4096 see: mqtt mosquitto linux connection limit

    0 讨论(0)
  • 2021-02-09 12:11

    My issue resulted from the clientId being the same for the publisher/subscriber. Was getting errors with Persistence datastore already being in use as well.

    0 讨论(0)
  • 2021-02-09 12:13

    I got this exact same error using code similar to above. I found that changing the QOS to 0 fixed the problem.

    message.setQos(0);
    

    [Edit] A bit more digging and I discovered that the MQTT plugin for RabbitMQ doesn't support a QOS of 2. http://www.rabbitmq.com/mqtt.html

    0 讨论(0)
  • 2021-02-09 12:13

    In my case this was because I was accidentally using a tcp://... URL instead of ssl://... and the server was configured not to allow insecure connections.

    I also had to do as @Aidan said and reduce the QoS from 2 to 1.

    Edit: I'm not 100% sure, but I think the server I'm using is RabbitMQ, and that assigns a non-standard meaning to the QoS values. It's probably a more sensible meaning to be honest:

    Transient (QoS0) subscription use non-durable, auto-delete queues that will be deleted when the client disconnects.

    Durable (QoS1) subscriptions use durable queues. Whether the queues are auto-deleted is controlled by the client's clean session flag. Clients with clean sessions use auto-deleted queues, others use non-auto-deleted ones.

    0 讨论(0)
  • 2021-02-09 12:17

    client id is the problem, generating a random test

    MqttClient.generateClientId ();
    
    0 讨论(0)
提交回复
热议问题