Giter VIP home page Giter VIP logo

Comments (14)

knolleary avatar knolleary commented on August 20, 2024

The tricky part is that is an ActiveMQ specific header, which might mean nothing to another stomp implementation.

Need to consider how to expose this in a stomp meaningful way.

from node-red-nodes.

dceejay avatar dceejay commented on August 20, 2024

Well its a generic stomp option so we could just allow use of say msg.header to pass it in for the more advanced user.... Unless there really are a defined list of possible options.

from node-red-nodes.

mfeblowitz avatar mfeblowitz commented on August 20, 2024

That would suffice, and was the first thing I tried. There could be other header items needing to be passed through, such as Stomp extensions for JMS message semantics.Then it's a matter of having access to header option documentation.

from node-red-nodes.

dceejay avatar dceejay commented on August 20, 2024

I have pushed a fix so you can pass in msg.headers as an object containing what you want to the output node.
What we do still need to think about is how to also expose it in the UI - especially as that would be the only way to pass in headers to the subscribe side.

from node-red-nodes.

mfeblowitz avatar mfeblowitz commented on August 20, 2024

Ok - when/where would I see the fix? I'm curious, as I've just tried a one-line fix that includes msg.headers in the call to node.client.publish (18-stomp.js, line 138).

As for the subscribe side, I don't have an immediate need for any, but the ActiveMQ extensions to Stomp suggest the need. Still, it does seem an ActiveMQ-specific extension, so a UI-specific approach could be confusing. How about just extending stomp-out to look for and process msg.headers on input and documenting that these can be inserted upstream if needed?

from node-red-nodes.

dceejay avatar dceejay commented on August 20, 2024

npm update node-red-node-stomp
but yes is the same change (plus some words in the html etc)

no problem with the out node - that's exactly what it does - it's the in (subscribe) node that would be tricky as it has to be done through the UI (and we would then want the out to match - as well as being able to accept msg.headers)

from node-red-nodes.

mfeblowitz avatar mfeblowitz commented on August 20, 2024

Yes. npm... :) that, I knew. I was just looking at the file via the git browser and didn't see a change.

And, yes. There is no upstream node for the in (subscribe) node. D'Oh. So, yes, a challenge. It sounds similar to a config node, supplying header contents to both the in and out nodes. In this case, it would supply either a string describing the array of headers (JSON), or perhaps a multi-select, where each selectable option would be a header/value pair?

from node-red-nodes.

dceejay avatar dceejay commented on August 20, 2024

Well yes a simple text box to allow a string we parse into JSON would do it... but is ugly and not very helpful. The multi select would be better if we knew all the possible options... which I don't think we do. Need to think some more..
(Fix also pushed to git now)

from node-red-nodes.

mfeblowitz avatar mfeblowitz commented on August 20, 2024

Right - I was thinking about something different to the a priori known options. Think about how you would configure host:port as a TCP config - you provide both host and port. Then, you select a single host:port config for the TCP node. What if you could create a number of header:value options and then pick N of them to configure the stomp node (as opposed to one for TCP). It seems like a consistent UI approach, but a rather big ask to support the multi-select interface and config.

from node-red-nodes.

mfeblowitz avatar mfeblowitz commented on August 20, 2024

Ok - understanding this better now. And now I'm thinking that having the headers ride in to the out node from the prior node is adequate but ugly. It means that every stomp out will have to be paired with a pass-through node that punches in msg.headers. Or it means I'll have to "wrap" the out node, to get the headers specified. So I'm all for a solution suitable for both in and out, and for it to, at minimum, contain a headers text box or, better, to have a headers config node with same or, even better, to have a headers config node that collects individual header:value pairs or, best, that has same but has "activate" checkboxes on each (seems overkill for this node, for now).

from node-red-nodes.

dceejay avatar dceejay commented on August 20, 2024

Well it's only necessary if you need to set the headers... it's a consistent solution with the http node - so not too arduous - cut/paste works quite well... If you want to make it tidier you can always create a subflow node containing the pair you need.

from node-red-nodes.

mfeblowitz avatar mfeblowitz commented on August 20, 2024

Yup - good idea. That will suit me fine. Thanks!

from node-red-nodes.

shyam2017 avatar shyam2017 commented on August 20, 2024

Able to send the Json message as Text message using below command- Stomp (Python)
conn.send(body=json.dumps(json_content), destination=destination, headers={'amq-msg-type':'text'})

from node-red-nodes.

hardillb avatar hardillb commented on August 20, 2024

@shyam2017 This issue was closed over 8 years ago and is specifically to do with sending messages via the Node-RED platform which runs on NodeJS. It really is not clear what link your comment has to any of this.

Please use the Node-RED forum or Slack to ask questions, if you believe you have an actual issue, open a new one, give full details and you can reference this one if needed.

from node-red-nodes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.