Artemis - Cannot get scheduled messages to work with AMQP and Topic

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Artemis - Cannot get scheduled messages to work with AMQP and Topic

Matthias Hanisch
Hi,

I would like to send a message deferred on a topic (multicast address), but
my problems is that the listener immediately receives the message.

The producer is build based on qpid-jms-client 0.25. I have tried to set
JMSDeliveryTime and/or _AMQ_SCHED_DELIVERY messsage property in the
following way

            long deliveryTime = System.currentTimeMillis() + 60000;
            message.setJMSDeliveryTime(deliveryTime);
            message.setLongProperty("_AMQ_SCHED_DELIVERY", deliveryTime);

Is there anything else I am missing, some setup or extra properties? Or is
this supported at all?
Or is it a problem using multi-cast?

I am using artemis 2.4.0-SNAPSHOT from last week.

Many thanks in advance,
Matthias

--
camLine GmbH
85238 Petershausen, Industriering 4a, Deutschland
Amtsgericht München HRB 88821
Geschäftsführer: Heinz Linsmaier (CEO), Bernhard Jofer, Georg Ruetz
<http://www.camline.com/en/camline/events.html>
<http://www.camline.com/en/camline/events.html>
<http://www.camline.com/en/camline/events.html>
Reply | Threaded
Open this post in threaded view
|

Re: Artemis - Cannot get scheduled messages to work with AMQP and Topic

Matthias Hanisch
This seems to be a qpid problem. I debugged through the code and my
delivery time above gets overwritten.
Currently you can only set it using
            producer.setDeliveryDelay(60000);

And then scheduled messages work. So sorry for the noise.

2017-10-18 15:49 GMT+02:00 Matthias Hanisch <[hidden email]>:

> Hi,
>
> I would like to send a message deferred on a topic (multicast address),
> but my problems is that the listener immediately receives the message.
>
> The producer is build based on qpid-jms-client 0.25. I have tried to set
> JMSDeliveryTime and/or _AMQ_SCHED_DELIVERY messsage property in the
> following way
>
>             long deliveryTime = System.currentTimeMillis() + 60000;
>             message.setJMSDeliveryTime(deliveryTime);
>             message.setLongProperty("_AMQ_SCHED_DELIVERY", deliveryTime);
>
> Is there anything else I am missing, some setup or extra properties? Or is
> this supported at all?
> Or is it a problem using multi-cast?
>
> I am using artemis 2.4.0-SNAPSHOT from last week.
>
> Many thanks in advance,
> Matthias
>

--
camLine GmbH
85238 Petershausen, Industriering 4a, Deutschland
Amtsgericht München HRB 88821
Geschäftsführer: Heinz Linsmaier (CEO), Bernhard Jofer, Georg Ruetz
<http://www.camline.com/en/camline/events.html>
<http://www.camline.com/en/camline/events.html>
<http://www.camline.com/en/camline/events.html>
Reply | Threaded
Open this post in threaded view
|

Re: Artemis - Cannot get scheduled messages to work with AMQP and Topic

tabish121@gmail.com
On 10/18/2017 11:09 AM, Matthias Hanisch wrote:
> This seems to be a qpid problem. I debugged through the code and my
> delivery time above gets overwritten.
> Currently you can only set it using
>              producer.setDeliveryDelay(60000);
>
> And then scheduled messages work. So sorry for the noise.

Not a Qpid problem at all, the JMS API clearly states that's how this works:

void setJMSDeliveryTime(long deliveryTime)
                         throwsJMSException

Sets the message's delivery time value.

This method is for use by JMS providers only to set this field when a
message is sent. This message cannot be used by clients to configure the
delivery time of the message. This method is public to allow a JMS
provider to set this field when sending a message whose implementation
is not its own.




>
> 2017-10-18 15:49 GMT+02:00 Matthias Hanisch <[hidden email]>:
>
>> Hi,
>>
>> I would like to send a message deferred on a topic (multicast address),
>> but my problems is that the listener immediately receives the message.
>>
>> The producer is build based on qpid-jms-client 0.25. I have tried to set
>> JMSDeliveryTime and/or _AMQ_SCHED_DELIVERY messsage property in the
>> following way
>>
>>              long deliveryTime = System.currentTimeMillis() + 60000;
>>              message.setJMSDeliveryTime(deliveryTime);
>>              message.setLongProperty("_AMQ_SCHED_DELIVERY", deliveryTime);
>>
>> Is there anything else I am missing, some setup or extra properties? Or is
>> this supported at all?
>> Or is it a problem using multi-cast?
>>
>> I am using artemis 2.4.0-SNAPSHOT from last week.
>>
>> Many thanks in advance,
>> Matthias
>>

--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply | Threaded
Open this post in threaded view
|

Re: Artemis - Cannot get scheduled messages to work with AMQP and Topic

Matthias Hanisch
Ok. I misinterpreted the explanations in "Protocols and Interoperability /
AMQP scheduling message delivery".
By the way: the section "Scheduled Messages" suggests using property
_AMQ_SCHED_DELIVERY
which has no effect at all. At least not with AMQP.

Thanks for clarification,
Matthias


2017-10-18 17:13 GMT+02:00 Timothy Bish <[hidden email]>:

> On 10/18/2017 11:09 AM, Matthias Hanisch wrote:
>
>> This seems to be a qpid problem. I debugged through the code and my
>> delivery time above gets overwritten.
>> Currently you can only set it using
>>              producer.setDeliveryDelay(60000);
>>
>> And then scheduled messages work. So sorry for the noise.
>>
>
> Not a Qpid problem at all, the JMS API clearly states that's how this
> works:
>
> void setJMSDeliveryTime(long deliveryTime)
>                         throwsJMSException
>
> Sets the message's delivery time value.
>
> This method is for use by JMS providers only to set this field when a
> message is sent. This message cannot be used by clients to configure the
> delivery time of the message. This method is public to allow a JMS provider
> to set this field when sending a message whose implementation is not its
> own.
>
>
>
>
>
>
>> 2017-10-18 15:49 GMT+02:00 Matthias Hanisch <[hidden email]
>> >:
>>
>> Hi,
>>>
>>> I would like to send a message deferred on a topic (multicast address),
>>> but my problems is that the listener immediately receives the message.
>>>
>>> The producer is build based on qpid-jms-client 0.25. I have tried to set
>>> JMSDeliveryTime and/or _AMQ_SCHED_DELIVERY messsage property in the
>>> following way
>>>
>>>              long deliveryTime = System.currentTimeMillis() + 60000;
>>>              message.setJMSDeliveryTime(deliveryTime);
>>>              message.setLongProperty("_AMQ_SCHED_DELIVERY",
>>> deliveryTime);
>>>
>>> Is there anything else I am missing, some setup or extra properties? Or
>>> is
>>> this supported at all?
>>> Or is it a problem using multi-cast?
>>>
>>> I am using artemis 2.4.0-SNAPSHOT from last week.
>>>
>>> Many thanks in advance,
>>> Matthias
>>>
>>>
> --
> Tim Bish
> twitter: @tabish121
> blog: http://timbish.blogspot.com/
>
>

--
camLine GmbH
85238 Petershausen, Industriering 4a, Deutschland
Amtsgericht München HRB 88821
Geschäftsführer: Heinz Linsmaier (CEO), Bernhard Jofer, Georg Ruetz
<http://www.camline.com/en/camline/events.html>
<http://www.camline.com/en/camline/events.html>
<http://www.camline.com/en/camline/events.html>