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

How to set message properties, example AMQ_SCHEDULED_DELAY #16

Closed
sbansal6 opened this issue May 5, 2015 · 2 comments
Closed

How to set message properties, example AMQ_SCHEDULED_DELAY #16

sbansal6 opened this issue May 5, 2015 · 2 comments

Comments

@sbansal6
Copy link

sbansal6 commented May 5, 2015

hi, how do i set AMQ_SCHEDULED_DELAY property of the message (this property delays the sending of the message, http://activemq.apache.org/delay-and-schedule-message-delivery.html

I am using the following code to send the message

var channel = new stompit.ChannelFactory(connectionManager);
channel.send(queue, messageText, function(error) {
if (error) {
var error = new Error('Cannot sendMessage: ' + messageText + ' : ' + error);
callback(error);
}
else {
console.log('Successfully sent message on queue ' + queue + ':' + messageText);
callback()
}

});
@gdaws
Copy link
Owner

gdaws commented May 8, 2015

My assumption is ActiveMQ's stomp adapter accepts jms message properties as stomp headers, and your question is how to set headers in stompit. The first parameter of the channel send method can be passed a header object argument. Here's a code example:

channel.send({
    'destination': queue,
    'AMQ_SCHEDULED_DELAY': delayNumber
}, messageText, sentHandler);

@sbansal6
Copy link
Author

sbansal6 commented May 8, 2015

@gdaws 👍 Thanks a lot. it works .

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