How to send message to JMS queue using javascript?

Umer

I have made a web-server using node.js, now on my client side (which I have made using java-script), when a user clicks send button, instead of a post request (XMLHttpRequest), I want to send the data to JMS queue. How can I implement that in javascript.

Petter Nordlander

JMS is a Java-only API. There is no way to make JavaScript implement Java-API unless you actually run the JS on top of java (Rhino or whatever). But that does not seems to be the case here.

Theoretically - it's possible to implement a C++ wrapper using JNI to talk to java classes that can use JMS. That wrapper then has to be adapted to Node/V8 extension.. Well, it's a lot of error prone work. Don't go this way.

The solution is not to use JMS. Most JMS implementations (ActiveMQ, IBM WebSphere MQ, etc.) usually have multiple ways to communicate with it. Usually there is a C/C++ client that can be used by a Node.js extension.

There are also standardized wire-protocols that JMS brokers commonly supports that can be used with existing Node.js extensions. AMQP 1.0, MQTT, STOMP. Also, many message brokers have some possibility (addon or similar) to accept messages through HTTP.

So please explore what possible communication methods your JMS implementation has.

As a fallback solution, simply write a small java program that listen to HTTP and produces JMS messages that you can call from your Node.js app.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to send multiple number of message to queue using jms

How to send Message to particular Receiver using JMS Queue

Send message to a JMS queue using Spring Boot

Send a Message to JMS queue using java Swing

Send a message to wildfly JMS message queue using spring boot

Unable to send JMS message to activemq Queue using Spring's JmsTemplate

How to send original message payload to jms error queue

Send message from MQ to EMS(JMS) queue

Is there a framework in apache spark to send message in a JMS queue?

How to send a jms message to activeMQ and decode it in javascript with mqttJS properly

Send XML content to a JMS queue using Java

Posting a message in JMS queue using JAVA

Post a message to a remote JMS queue using JBoss

how to send response to a sender from ESB before adding message to a jms queue

Java JMS - Send message to Dead Letter Queue explicitly

How to send message to the rabbitmq queue using spring integration java DSL

How to send batch message to a sqs queue using apache camel

JMS queue receive message?

How to send Multiple message to JMS Endpoint in Mule

How to put failed custom object of javax.mail.Message into jms queue (using Activemq)

How to Identify the Message Queue name in Spring Jms Message Listener

Read large files and send to jms queue using spring batch

Dequeue Non_Persistent message from AQ Queue using JMS

Using JMSCorrelationId as selector while receiving Jms message from queue

how do i send a message to a ActiveMQ using JMS Sender in wso2esb

JMS - How do message selectors work with multiple queue and topic consumers?

how to get JMS payload and header Message and queue type

How to retain JMS Queue Message even after successful read?

How to send queue message to multipule receiver in freeRTOS?