2

I have this spring integration config. The JMS broker is Sonic MQ. For some reason a connection cannot be established if I add a selector. I get lots of connection refreshed logs. It works fine without the selector. Is this a know issue for Sonic MQ in Spring integration? I am unable to find any examples of a Sonic MQ config in spring integration.

<int-jms:message-driven-channel-adapter
    id="itemListener" 
    channel="jmsInChannel"  
    destination="itemTopic"
    selector="Content_Type = 'application/json'"
    connection-factory="sonicConnectionFactory"
    subscription-durable="false" 
    durable-subscription-name="item-subcription" 
/>

<bean id="sonicConnectionFactory"class="progress.message.jclient.ConnectionFactory">
    <property name="ConnectionURLs" value="${jms.sonic.urls}" />
    <property name="DefaultUser" value="${jms.sonic.username}" />
    <property name="DefaultPassword" value="${jms.sonic.password}" />
    <property name="ReconnectInterval" value="30" />
    <property name="ReconnectTimeout" value="0" />
</bean>
  • No op... Need to see StackTrace on the matter. But from other side, please, study Sonic MQ documentation for all those `topic` options. Like you have `subscription-durable="false"`, but just after that configure `durable-subscription-name="item-subcription"`... Try to make the first one as `true`. – Artem Bilan Aug 14 '15 at 18:05
  • I set the subscription-durable="true" and I get the same results. I don't see anything interesting be logged. Lots of this. 08/14 16:19:05.125 INFO [o.s.j.l.DefaultMessageListenerContainer]:915:org.springframework.jms.listener.DefaultMessageListenerContainer#10-10 - Successfully refreshed JMS Connection 08/14 16:19:05.865 DEBUG [o.s.i.e.PollingConsumer]:208:task-scheduler-8 - Received no Message during the poll, returning 'false' 08/14 16:19:05.970 DEBUG [o.s.i.e.PollingConsumer]:208:task-scheduler-6 - Received no Message during the poll, returning 'false' – Will Carson Aug 14 '15 at 20:24
  • That says that everything is OK... Maybe the issue just because there is no messages in that `topic`?.. – Artem Bilan Aug 14 '15 at 20:35
  • No. There are messages on the topic. If I remove the selector messages are coming through. It's Successfully refreshing JMS Connection every 15 or so seconds. That doesn't happen if the selector is removed. It doesn't seem to be staying connected withe the selector added. – Will Carson Aug 14 '15 at 20:46
  • OK. Can't you have that `selector` as bad one? – Artem Bilan Aug 14 '15 at 20:56
  • If I use any thing for the selector i get that. The only thing that doesn't cause a problem is if i use 'selector=""' – Will Carson Aug 14 '15 at 21:15
  • Well, looks like the `selector` does work with SI + Sonic MQ. There is just need to figure out the proper value for it :-). – Artem Bilan Aug 14 '15 at 21:19
  • Can you point me to an example somewhere? I don't understand why adding a selector would cause the connection to be dropped. If I use the same selector values with an MQ broker I don't have an issue. If the selector was bad I would think the connection would not be dropped, but no messges would get through. – Will Carson Aug 14 '15 at 21:24
  • The Spring Integration `` is fully based on the Spring JMS foundation. It is just a light-weight wrapper. But the last one is implemented on the standard JMS API. So, if you are facing some issue with the Spring Integration, you should get the same just with the raw Java program. So, I'd recommend you come up with the simple test-case based just on the JMS to have some hooks to play with the problem. If that, of course. – Artem Bilan Aug 15 '15 at 00:16

0 Answers0