Announcement Announcement Module
Collapse
No announcement yet.
Only receive the first message (Spring + ActiveMQ) when using publish-subscribe Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Only receive the first message (Spring + ActiveMQ) when using publish-subscribe

    Hello,
    I am getting the first message only - Spring 3.0 + Integration 2.0M2 + ActiveMQ 5.3.0.

    Here is my configuration:
    -----------------------
    <bean id="requestTopic" class="org.apache.activemq.command.ActiveMQTopic">
    <constructor-arg value="STOCKS.*"/>
    </bean>
    <integrationublish-subscribe-channel id="inChannel"></integrationublish-subscribe-channel>
    <integration:service-activator input-channel="inChannel" ref="gatewayBean"/>
    <jms:inbound-gateway id="jmsIn" request-destination="requestTopic" request-channel="inChannel"/>

    Here is my service activator:
    ---------------------------
    @MessageEndpoint
    public class GatewayBean {


    @ServiceActivator
    public void upperCase(String input) {
    System.out.println ("message received : " + input);
    // service.sendData(input);
    // return input.toUpperCase();
    }
    }


    I am using the default ActiveMQ configuration, no changes.

    Here is the debug messages I have:
    ----------------------------------
    08:51:48,776 DEBUG DefaultMessageListenerContainer:311 - Received message of type [class org.apache.activemq.command.ActiveMQTextMessage] from consumer [Cached JMS MessageConsumer: ActiveMQMessageConsumer { value=ID:lchu-3953-1263948699120-0:0:1:1, started=true }] of session [Cached JMS Session: ActiveMQSession {id=ID:lchu-3953-1263948699120-0:0:1,started=true}]
    08:51:48,792 DEBUG HeaderMappingMessageConverter:158 - converted JMS Message [ActiveMQTextMessage {commandId = 30, responseRequired = false, messageId = ID:lchu-3901-1263948353844-2:1:1:1:26, originalDestination = null, originalTransactionId = null, producerId = ID:lchu-3901-1263948353844-2:1:1:1, destination = topic://STOCKS.MSFT, transactionId = null, expiration = 0, timestamp = 1263948708761, arrival = 0, brokerInTime = 1263948708761, brokerOutTime = 1263948708761, correlationId = null, replyTo = null, persistent = false, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, text = <price stock='MSFT' bid='28.054881367399684' ...ement='up'/>}] to integration Message [[Payload=<price stock='MSFT' bid='28.054881367399684' offer='28.08293624876708' movement='up'/>][Headers={history=[], $jms_redelivered=false, $timestamp=1263948708776, $jms_messageId=ID:lchu-3901-1263948353844-2:1:1:1:26, $id=38f21120-4502-4438-99c5-9f4204495cd0}]]
    08:51:48,808 DEBUG PublishSubscribeChannel:251 - preSend on channel 'inChannel', message: [Payload=<price stock='MSFT' bid='28.054881367399684' offer='28.08293624876708' movement='up'/>][Headers={$jms_redelivered=false, history=[[name=inChannel;type=channel;timestamp=126394870880 8]], $replyChannel=org.springframework.integration.chan nel.MessageChannelTemplate$TemporaryReplyChannel@a df5be, $errorChannel=org.springframework.integration.chan nel.MessageChannelTemplate$TemporaryReplyChannel@a df5be, $timestamp=1263948708776, $jms_messageId=ID:lchu-3901-1263948353844-2:1:1:1:26, $id=38f21120-4502-4438-99c5-9f4204495cd0}]
    08:51:48,808 DEBUG ServiceActivatingHandler:60 - ServiceActivator for [com.metaverse.message.GatewayBean]] received message: [Payload=<price stock='MSFT' bid='28.054881367399684' offer='28.08293624876708' movement='up'/>][Headers={$jms_redelivered=false, history=[[name=inChannel;type=channel;timestamp=126394870880 8]], $replyChannel=org.springframework.integration.chan nel.MessageChannelTemplate$TemporaryReplyChannel@a df5be, $errorChannel=org.springframework.integration.chan nel.MessageChannelTemplate$TemporaryReplyChannel@a df5be, $timestamp=1263948708776, $jms_messageId=ID:lchu-3901-1263948353844-2:1:1:1:26, $id=38f21120-4502-4438-99c5-9f4204495cd0}]
    message received : <price stock='MSFT' bid='28.054881367399684' offer='28.08293624876708' movement='up'/>
    08:51:48,823 DEBUG ServiceActivatingHandler:107 - handler 'ServiceActivator for [com.metaverse.message.GatewayBean]]' produced no reply for request Message: [Payload=<price stock='MSFT' bid='28.054881367399684' offer='28.08293624876708' movement='up'/>][Headers={$jms_redelivered=false, history=[[name=inChannel;type=channel;timestamp=126394870880 8], [name=ServiceActivator for [com.metaverse.message.GatewayBean]];type=endpoint;timestamp=1263948708808]], $replyChannel=org.springframework.integration.chan nel.MessageChannelTemplate$TemporaryReplyChannel@a df5be, $errorChannel=org.springframework.integration.chan nel.MessageChannelTemplate$TemporaryReplyChannel@a df5be, $timestamp=1263948708776, $jms_messageId=ID:lchu-3901-1263948353844-2:1:1:1:26, $id=38f21120-4502-4438-99c5-9f4204495cd0}]
    08:51:48,823 DEBUG PublishSubscribeChannel:264 - postSend (sent=true) on channel 'inChannel', message: [Payload=<price stock='MSFT' bid='28.054881367399684' offer='28.08293624876708' movement='up'/>][Headers={$jms_redelivered=false, history=[[name=inChannel;type=channel;timestamp=126394870880 8], [name=ServiceActivator for [com.metaverse.message.GatewayBean]];type=endpoint;timestamp=1263948708808]], $replyChannel=org.springframework.integration.chan nel.MessageChannelTemplate$TemporaryReplyChannel@a df5be, $errorChannel=org.springframework.integration.chan nel.MessageChannelTemplate$TemporaryReplyChannel@a df5be, $timestamp=1263948708776, $jms_messageId=ID:lchu-3901-1263948353844-2:1:1:1:26, $id=38f21120-4502-4438-99c5-9f4204495cd0}]


    Appreciate your help !
    canal

  • #2
    use message-driven-channel-adapter is ok.

    Comment

    Working...
    X