MassTransit - schedule message with custom headers - masstransit

I schedule messages using IMessageScheduler interface. I need to set some custom headers for scheduled messages but I cannot find a way to do that.
For standard (not-scheduled) send/publish I do this using Action<SendContext<T>>/Action<PublishContext<T>> callbacks but I cannot see any similar arguments in IMessageScheduler interface. Is there any possibility to set headers for scheduled messages?

There aren't built-in extension methods, but you can create a pipe and pass it when scheduling the message:
ScheduleSend(message, Pipe.ExecuteAsync<SendContext<T>>(context => context.Headers.Set(...)

Related

How can I automatically filter Outlook messages I sent and I did not receive a reply?

I found several workarounds, but they need manual actions. I am trying to come up with a solution (built in or a macro) to automatically filter out conversations where I was the last one to send a message.

Textlocal: What happens to messages scheduled in future whose template is changed (after scheduling)

I have scheduled my message for a future date. The message template used was the following:
"Hi, we have sent you a text" while scheduling the messages.
Now, if I change the template in between today and the scheduled date, to
"This is the new template", will the message get delivered? Or will it not get sent due to template error?
Also, if the messages are sent, what is the template of messages used in these? The new one or the the one with which they were scheduled.
This has got nothing to do with ruby, per say.
You are using the txtlocal API to create a scheduled SMS. When that event is scheduled, it on their servers, not yours. So if you then change the template, it cannot possibly propagate
that change to the scheduled messages automatically.
In order to implement this, you would need to fetch the scheduled messages, cancel any that need changing (unless there's a way to update scheduled messages that I cannot see?), then re-schedule them.
I got the answer to my question.
If the messages are scheduled and we change the template afterwards, the messages will be delivered without any error but with old template.

Glympse API event handling

I am trying to launch glympse app by using an intent and receiving the information through broadcast. Is there any way that I will be notified about the events occurring like ticket removed, expired, updated etc?
There sure is.
We created a library project to make this easier for you. It can be found here: https://github.com/Glympse/glympse-app-sdk/tree/master/Android/GlympseIntentsLib
A sign-in is required to view these documents that might be helpful.
Tutorial: https://developer.glympse.com/Content/client/app/guides/Glympse_Intents_Tutorial.html
Reference Docs: https://developer.glympse.com/Content/client/app/guides/Glympse_Intents_Reference.html
Specifically, check out the method CreateGlympseParams.setCallbackAction(String). This will allow you to set an action which will be used to broadcast a message back to your app.
Another option is to use CreateGlympseParams.setEventsListener(EventsListener). With this method, you can supply an object that implements GlympseApp.EventsListener. Using this method, our library handles the broadcast under the covers and your object's methods will be invoked as the event occur.

JMS Body content filter [duplicate]

I m implementing Pub/Sub model using JMS. I send a message from Pub to all Subscribers. I want that subscribers should get filtered messages based on some string in actual message body.
For example a subscriber subscribe to a topic 'sports' and should receive only those posts which has keyword 'cricket' in it in the message text body.
p.s. I dont want to use message selectors.
How can I implement this.
Thanks and Regards.
Take a look at apache camel. It provides a means of routing and filtering messages and has excellent integration with Active MQ.
You can use no mechanism for filtering messages on a topic based on the Message Body contents. Usually a JMS Selector is used for filtering messages but even this does not work for Body Contents:
From The Java EE 6 Tutorial:
A
message selector cannot select messages on the basis of the content of the message body..
The issue here is that you have to first receive (that is consume) the message and then extract its contents which precludes the case of any kind of Body filtering.
You cannot do that with JMS itself.
What you typically do is to make the sending application use different queues depending on message type (orders, customer prospects, invoices, status reports or whatnot). If you don't want to use separate queues, you can at least make the sending application mark the message with some property that you can filter on using a selector.
In some cases, where you still need to do routing and/or filtering based on the actual content of a message, there are tailor made software for that kind of thing. Apache Camel and Mule ESB are two options.

Filtering in JMS based on body content

I m implementing Pub/Sub model using JMS. I send a message from Pub to all Subscribers. I want that subscribers should get filtered messages based on some string in actual message body.
For example a subscriber subscribe to a topic 'sports' and should receive only those posts which has keyword 'cricket' in it in the message text body.
p.s. I dont want to use message selectors.
How can I implement this.
Thanks and Regards.
Take a look at apache camel. It provides a means of routing and filtering messages and has excellent integration with Active MQ.
You can use no mechanism for filtering messages on a topic based on the Message Body contents. Usually a JMS Selector is used for filtering messages but even this does not work for Body Contents:
From The Java EE 6 Tutorial:
A
message selector cannot select messages on the basis of the content of the message body..
The issue here is that you have to first receive (that is consume) the message and then extract its contents which precludes the case of any kind of Body filtering.
You cannot do that with JMS itself.
What you typically do is to make the sending application use different queues depending on message type (orders, customer prospects, invoices, status reports or whatnot). If you don't want to use separate queues, you can at least make the sending application mark the message with some property that you can filter on using a selector.
In some cases, where you still need to do routing and/or filtering based on the actual content of a message, there are tailor made software for that kind of thing. Apache Camel and Mule ESB are two options.

Resources