I believe that's expected because =NULL is unknown.

The filtering is essentially the SQL92 subset JMS / Jakarta Messaging
outlines here:
https://jakarta.ee/specifications/messaging/3.1/apidocs/jakarta.messaging/jakarta/jms/message

Note it outlines that "If a property that does not exist in a message
is referenced, its value is NULL", and then later that for a
comparison operator like =, "If either of the type values evaluates to
NULL, the value of the expression is unknown."

On Tue, 16 Jan 2024 at 10:41, Calle Andersson
<calleanders...@hotmail.com> wrote:
>
> Hi,
>
> I’m not sure if I have discovered a bug in Artemis (2.31.2) or if I have 
> misunderstood something.
>
> I used the following command to create a new instance:
> apache-artemis-2.31.2/bin/artemis create --user admin --password admin 
> --no-autocreate --require-login myBroker
>
> I have added the following address:
> <address name="TEST.QUEUE.A">
>                              <anycast>
>                                                           <queue 
> name="TEST.QUEUE.A">
>                                                                               
>          <filter string="NOT(MyHeader='lorem')" />
>                                                           </queue>
>                              </anycast>
> </address>
>
> When sending a message with the “MyHeader” header set to “ipsum”, the message 
> ends up on the queue (as expected).
>
> However, if the “MyHeader” header is missing, the message simply disappears. 
> E.g. when using the following command:
> ./artemis producer --url tcp://localhost:61616  --user admin --password admin 
> --message-count 1 --destination TEST.QUEUE.A --message "no header"
> (BTW, is it somehow possible to specify custom headers when using the 
> producer command? I’ve not seen any information about support for that but it 
> could be handy in some cases.)
>
> I expected messages without “MyHeader” header to end up on the queue (given 
> the filter above). Instead, I have to use the following filter to make 
> messages without the header to end up on the queue:
> <filter string="(MyHeader IS NULL) OR (NOT(MyHeader='lorem'))" />
>
> Is this a bug or a feature?
>
> Regards,
> Calle
>

Reply via email to