Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: service-activator not getting message payload?

  1. #11
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    I don't know what you are using to post those logs, but having no line feeds in them make them very hard to read.

    Dispatcher has no subscribers for channel toPersist.
    Means you are sending the response to a channel called 'toPersist' and there is nothing currently subscribed to it (has it as an input-channel).

    Since that channel is not in the configuration in your first post, I can't tell exactly what you are trying to do with the response.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  2. #12
    Join Date
    Jan 2013
    Posts
    17

    Default

    Yes, it's annoying to me as well.I have the Enhanced Interface - Full WYSIWYG Editing option selected from Settings -> General Settings -> Miscellaneous Options for the forum settings, but all I get is a plain text box that doesn't even keep the line feeds.For example, as I type it in the text box, this post has 3 lines, but I'm guessing when I hit Submit Reply, it's going to come out as just one. This is happening in both Chrome 24 and IE 8

  3. #13
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    I use the basic editor (I'm a command line kind of guy), Might I humbly suggest you turn off WYSIWIG? Your posts are very hard to read.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  4. #14
    Join Date
    Jan 2013
    Posts
    17

    Default

    Okay, lets try this one:

    Here's the config:

    Code:
    <!-- SERVER SIDE -->
    	
    	<bean id="byteArrayStxEtxSerializer" class="org.springframework.integration.ip.tcp.serializer.ByteArrayStxEtxSerializer">
    		<property name="maxMessageSize" value="102400"/>
    	</bean>
    	<bean id="isResponseUtils" class="com.fmer.omdm.util.ISResponseUtils"/>
    	
    	<int:channel
    		id="rawResponse"/>
    		
    	<int:channel
    		id="stringResponse"
    		datatype="java.lang.String"/>
    		
    	<int:channel
    		id="toPersist"
    		datatype="java.lang.String"/>	
    		
    	<int-ip:tcp-connection-factory
    		id="isListener"
    		type="server"
    		host="localhost"
    		port="${infoserver.response.port}"
    		so-keep-alive="true"
    		single-use="false"
    		deserializer="byteArrayStxEtxSerializer"/>
    		
    	<int-ip:tcp-inbound-channel-adapter
    		id="inboundResponse"
    		channel="rawResponse"
    		connection-factory="isListener"/>
    
    	<int:transformer
    		id="rawResponse2String"
    		input-channel="rawResponse"
    		output-channel="stringResponse"
    		expression="new String(payload)"/>
    				
    	<int:service-activator
    		input-channel="stringResponse"
    		output-channel="toPersist"
    		ref="isResponseUtils"
    		method="showResponse"/>
    I was reading through the documentation and I think I need to implement a messaging endpoint by changing the toPersist channel to subscribable and then have some event driven consumer. Something that will take the payload of the toPersist channel and do something with it?

  5. #15
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    Right - not sure what your existing service ("isResponseUtils") does, but is it invoked by the framework because it is subscribed to 'stringResponse' which is the output-channel of the transformer which, in turn, is subscribed to 'rawResponse'. Since these channels are 'DirectChannel's, this all runs on the same thread. When a channel is a DirectChannel (or any Subscribable channel), it MUST have a subscriber.

    So, you need something to 'consume' messages on 'toPersist'. This can be a <service-activator/>, or an <outbound-channel-adapter/> which simply receives the payload.

    Or, you can make 'toPersist' a QueueChannel (by adding a <queue/> child element to the <channel/> definition). In that case, it's a PollableChannel and doesn't need a subscriber. Instead, you poll such a channel - either using a <poller/> or you can inject the channel into your code and simply hang on the receive() method.

    In most cases, however, we don't recommend exposing the messaging infrastructure to user code - a simple event-driven POJO, invoked by a <service-activator/> or <outbound-channel-adapter/> is cleaner.

    You often see QueueChannels used in test cases - where the flow dumps the result into a QueueChannel and the test case retrieves the message and verifies the content.
    Last edited by Gary Russell; Feb 1st, 2013 at 11:30 AM.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  6. #16
    Join Date
    Jan 2013
    Posts
    17

    Thumbs up

    That's what I needed to fix.

    I changed the <service-activator/> to an <outbound-channel-adapter/> and the error's gone.

    Thanks for the help on this.

    If I could buy you a beer, I would..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •