Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with content_type for Apache ActiveMQ #424

Open
jhgil opened this issue Jul 29, 2024 · 1 comment
Open

issue with content_type for Apache ActiveMQ #424

jhgil opened this issue Jul 29, 2024 · 1 comment

Comments

@jhgil
Copy link

jhgil commented Jul 29, 2024

Hello,
I don't know if it's a problem, the body of the messages I send have a binary format, for example:

SpESsESw��Hello, ActiveMQ

i am using Apache activeMQ v5.15.6, node v20.15.1, npm v10.7.0
Screenshot 2024-07-29 at 5 00 27 PM

    connection.once('connection_open', () => {      
      const sender = connection.open_sender('readings');      
      sender.once('sendable', () => {
        let message = "Hello, ActiveMQ";
        
        sender.send({
          body: message          
        });
        
        console.log(`Mensaje enviado a mi_cola: ${message}`);
        
        
        setTimeout(() => {
          sender.close();
          connection.close();
        }, 500);
      });
    });

how can I force the body of a message to be encoded as plain JSON or text plain data?

@grs
Copy link
Member

grs commented Jul 30, 2024

The message body is being sent as a string. However, as rhea is an AMQP library, the messages as a whole is encoded in the AMQP type system.

I believe ActiveMQ by default treats the entire AMQP message as the body of a JMS BytesMessage. See 'Mapping to JMS' in https://activemq.apache.org/components/classic/documentation/amqp. You may need to configure the broker to choose a different treatment e.g. 'jms'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants