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

Thread: tcp-outbound-gateway - failed to send Message to channel

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

    Default

    I just pasted your tcp config into the tcp sample and it works fine for me.

    The error you posted makes no sense for the configuration you posted; the error implies there is no consumer for the input channel when, clearly, the outbound gateway consumes those messages (and is born out by my successfully using your config).

    Are you sure everything you posted is in synch?

    If you can't figure it out, please post a full debug log of the complete test.

  2. #12
    Join Date
    Jan 2011
    Posts
    6

    Default

    Could the fact that I am trying to send to the gateway via an init method (run) be the reason for this? Also I am using SWT. Are there any known issues with Spring Integration and SWT? Thank you so much!

    I am calling gateway.send("Test") inside of the run method which is an init-method.

    Code:
    <beans:bean id="transportClientMonitor" class="com.company.transport.client.monitor.TransportClientMonitor" init-method="run" />
    To be more precise, I am using an @Autowired gateway and doing gateway.send.

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

    Default

    Yes, possibly; especially because you are not injecting the gateway into your transportClientMonitor so Spring doesn't know anything about the dependency.

    I assume you are getting a reference to the gateway using this...

    Code:
    <beans:bean id="appContext" class="com.company.transport.util.AppContext" />
    Why not inject the dependency?

    Also, I'll have to defer to Mark and Oleg about the wisdom of trying to use SI from within an init-method.

  4. #14
    Join Date
    Jan 2011
    Posts
    6

    Default

    Hi Gary,

    I was originally using the AppContext bean you mentioned to get the dependency. Then I switched to using @Autowired and injected it directly into the class as a field member. Both ways yielded the same result.

    I figured out the reason as to why it was not working. I am using SWT to create my GUI. I was creating a display via the init-method and this was blocking the thread I suppose. So the gateway initialization could not complete. Once I removed the SWT stuff, everything worked fine. So the initial problem has been resolved however now I have a new problem.

    How do I use SWT and Spring together. I feel that this forum isn't the appropriate place for that, but feel free to leave any suggestions. Also, are you aware of any other good techniques (using Spring) for interprocess communication?

    Thanks Again!

Posting Permissions

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