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

Stomp node: error sending payload as XML #1068

Open
5 tasks done
martin-doyle opened this issue May 14, 2024 · 0 comments
Open
5 tasks done

Stomp node: error sending payload as XML #1068

martin-doyle opened this issue May 14, 2024 · 0 comments

Comments

@martin-doyle
Copy link

Which node are you reporting an issue on?

Stomp

What are the steps to reproduce?

  • Format payload as XML
  • Send payload via stomp out node

What happens?

  • Payload as JSON with XML inside

What do you expect to happen?

  • Payload as XML

Please tell us about your environment:

  • Node-RED version: 3
  • node.js version: 18
  • npm version: 10.7
  • Platform/OS: Linux, Windows
  • Browser: Chrome, Edge

When started

commit 0d7f0cb
STOMP refactor in accordance with MQTT (shared connection using confi…

Before

	node.on("input", function(msg) {
            node.client.publish(node.topic || msg.topic, msg.payload, msg.headers);
        });

After

            node.on("input", function(msg, send, done) {
                if (node.topic && msg.payload) {
                    try {
                        msg.payload = JSON.stringify(msg.payload);
                    } catch {
                        msg.payload = `${msg.payload}`;
                    }
                    node.serverConnection.publish(node.topic, msg.payload, msg.headers || {});
                    done();
                }
            });
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

1 participant