I assume you are using Mule JMS to connect to Solace. In that case, the Selector needs to be a standard JMS selector string.
The three characters # converted the whole thing into a Mule Expression Language. In your example, you don’t need the complexity of Mule Expression. So you should uncheck the “fx” button there, and simply use this string:
counter=1
In case that JMS header is not numberic then you should try:
counter='abc'
For more information regarding the selector syntax:
actually it looks like @etc is using the Solace PubSub+ connector for MuleSoft. But the answer @ivan_lkc provides should still work. As said, no need for a Mule expression, just a simple string of counter=1 should work. Under the covers, the connector will use JCSMP to do a ConsumerFlowProperties.setSelector() with the string you put in the property page field for Selector.
I am using the Solace PubSub+ connector for MuleSoft that use JCSMP.
Just for clarification, attributes.userProperties.counter is a dataweave expression and not MEL. It’s used to retrieve header attributes.
Just for reference, I have attached Consumer_NoSelector.PNG to show the counter=1 property being set.
However in the connector when I set the selector to counter=1 (as a string only and not as a dataweave expression), I also get null result. (Attached solaceconnector.log and Consumer_WithSelector.PNG)
Hi @etc , from the NoSelector screen capture, it seems “counter” is a String which equals “1”; It is not an Integer. Please try to replace selector string from counter=1
to counter='1'