简体   繁体   中英

AMQP 1.0 Qpid BytesMessage large payload

I am using the qpid client Java library (version 0.32) to integrate AMQP 1.0.

I have to transfer a byte array (less than 5mb), but this message is never delivered to the subscribers. I recorded the frames via wireshark and the transfer frames are flagged with [TCP Window Full] . The library is probably not dividing the payload. Is the code correct? What do I have to configure?

Broker: Apache Apollo 1.7.1 (default configuration)

pom.xml

    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-jms_1.1_spec</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.qpid</groupId>
        <artifactId>qpid-amqp-1-0-client-jms</artifactId>
        <version>0.32</version>
    </dependency>
    <dependency>
        <groupId>org.apache.qpid</groupId>
        <artifactId>qpid-amqp-1-0-client</artifactId>
        <version>0.32</version>
    </dependency>
    <dependency>
        <groupId>org.apache.qpid</groupId>
        <artifactId>qpid-amqp-1-0-common</artifactId>
        <version>0.32</version>
    </dependency>

Java code

  ConnectionFactoryImpl amqpFactory = new ConnectionFactoryImpl(...);
  ConnectionImpl connection = amqpFactory.createConnection();
  connection.start();
  SessionImpl session = connection.createSession(...);

  MessageProducerImpl producer = session.createProducer(new TopicImpl("topic://test"));
  BytesMessageImpl bytesMessage = session.createBytesMessage();

  //generate sample data
  StringBuilder s = new StringBuilder();
  for (int i = 0; i < 10000; i++) {
       s.append(UUID.randomUUID().toString());
  }

  bytesMessage.writeBytes(s.toString().getBytes());
  producer.send(bytesMessage);

So you have basically landed on every deprecated bit of AMQP software I know of so I would guess that your issue comes from one of the old and unmaintained pieces of software.

ActiveMQ Apollo has been deprecated an unmaintained for several years now, instead you should use ActiveMQ Artemis which is the most active broker in the ActiveMQ project.

For an AMQP 1.0 JMS client you should use the Qpid JMS client which implements the current AMQP -> JMS mapping specification and is actively maintained.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM