1

Spring Integration 2 を使用しています。次のシナリオがあります。body フィールドと受信者のリストで構成される「MassMessageObject」。リスト内のすべての受信者に対して「BasicMessageObject」を作成するスプリッターを実装しています。問題は、最初のメッセージのみがスプリッターの出力チャネルによって受信されることです。例えば:

MassMessageObject> [body: Hello, recipients{A,B}] BasicMessageObject {[body: Hello, recipient: A], [body: Hello, recipient: B]} のリストを作成しています。

出力チャネルに接続されたエンドポイントは、「[本文: Hello, 受信者: A]」を受信して​​いますが、「[本文: Hello, 受信者: B]」は受信していません。

以下は私のアプリケーションコンテキストです:

<int:splitter input-channel="mass_receiving_channel"
                  output-channel="receiving_channel"                  
                  method="splitMessages"
                  ref="massMessageSplitter"/>

<!-- Main Chain. The one that will lead to the messageTypeRouter -->
<int:chain input-channel="receiving_channel" output-channel="sms_channel">
        <int:service-activator ref="saveMessageToDB" method="saveMessageToDB"/>
        <int:gateway request-channel="message_type_router_channel"/>
</int:chain>

以下はスプリッターです...

public List<BasicMessageObject> splitMessages(final GenericMessage message) {
        List<BasicMessageObject> messages = new ArrayList<BasicMessageObject>();
        // DOING STUFF HERE 
        return messages;
    }
}





[springframework.integration.jms.ChannelPublishingJmsMessageListener:234] - converted JMS Message [ActiveMQObjectMessage {commandId = 6, responseRequired = true, messageId = ID:PC-CMICALLEF-61953-1335249128607-0:0:1:2:1, originalDestination = null, originalTransactionId = null, producerId = ID:PC-CMICALLEF-61953-1335249128607-0:0:1:2, destination = queue://mass_messaging_queue, transactionId = null, expiration = 0, timestamp = 1335249128840, arrival = 0, brokerInTime = 1335249128841, brokerOutTime = 1335249128842, correlationId = null, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence@39673d71, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false}] to integration Message payload [com.connexo.icubeplus3.dispatcher.connector.messageobjects.SmsMassMessageObject@28f2e328]
[springframework.integration.channel.DirectChannel:224] - preSend on channel 'mass_receiving_channel', message: [Payload=com.connexo.icubeplus3.dispatcher.connector.messageobjects.SmsMassMessageObject@28f2e328][Headers={timestamp=1335249128882, id=fb9904da-f5b1-49e0-af25-6711015f1365, jms_redelivered=false, jms_messageId=ID:PC-CMICALLEF-61953-1335249128607-0:0:1:2:1}]
[springframework.integration.splitter.MethodInvokingSplitter:72] - org.springframework.integration.splitter.MethodInvokingSplitter@56de9984 received message: [Payload=com.connexo.icubeplus3.dispatcher.connector.messageobjects.SmsMassMessageObject@28f2e328][Headers={timestamp=1335249128882, id=fb9904da-f5b1-49e0-af25-6711015f1365, jms_redelivered=false, jms_messageId=ID:PC-CMICALLEF-61953-1335249128607-0:0:1:2:1}]
[springframework.integration.splitter.MethodInvokingSplitter:157] - handler 'org.springframework.integration.splitter.MethodInvokingSplitter@56de9984' sending reply Message: [Payload=[SMS] [sender: icube+] [destination: +35611111111] [messageIdentifier: 1234] [clientId: 1]][Headers={timestamp=1335249137537, id=566d7d54-f4cc-4896-8d39-d95636c20a57, correlationId=fb9904da-f5b1-49e0-af25-6711015f1365, jms_redelivered=false, sequenceSize=4, sequenceNumber=1, jms_messageId=ID:PC-CMICALLEF-61953-1335249128607-0:0:1:2:1}]
[springframework.integration.channel.DirectChannel:224] - preSend on channel 'receiving_channel', message: [Payload=[SMS] [sender: icube+] [destination: +35611111111] [messageIdentifier: 1234] clientId: 1]][Headers={timestamp=1335249137537, id=566d7d54-f4cc-4896-8d39-d95636c20a57, correlationId=fb9904da-f5b1-49e0-af25-6711015f1365, jms_redelivered=false, sequenceSize=4, sequenceNumber=1, jms_messageId=ID:PC-CMICALLEF-61953-1335249128607-0:0:1:2:1}]
[springframework.integration.handler.MessageHandlerChain:72] - org.springframework.integration.handler.MessageHandlerChain#0 received message: [Payload=[SMS] [sender: icube+] [destination: +35611111111] [messageIdentifier: 1234] [clientId: 1]][Headers={timestamp=1335249137537, id=566d7d54-f4cc-4896-8d39-d95636c20a57, correlationId=fb9904da-f5b1-49e0-af25-6711015f1365, jms_redelivered=false, sequenceSize=4, sequenceNumber=1, jms_messageId=ID:PC-CMICALLEF-61953-1335249128607-0:0:1:2:1}]
[springframework.integration.handler.ServiceActivatingHandler:72] - ServiceActivator for [org.springframework.integration.handler.MethodInvokingMessageProcessor@27b71c12] received message: [Payload=[SMS] [sender: icube+] [destination: +35611111111] [messageIdentifier: 1234] [clientId: 1]][Headers={timestamp=1335249137537, id=566d7d54-f4cc-4896-8d39-d95636c20a57, correlationId=fb9904da-f5b1-49e0-af25-6711015f1365, jms_redelivered=false, sequenceSize=4, sequenceNumber=1, jms_messageId=ID:PC-CMICALLEF-61953-1335249128607-0:0:1:2:1}] .... 
4

1 に答える 1