Announcement Announcement Module
Collapse
No announcement yet.
still question about gateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • still question about gateway

    I am still confused about the gateway concept, if anybody can help me, that will be great.

    let's say I have a pojo bean and has a gateway as a property, then in each method do i call the gateway method to get into spring integration world? So is the following code correct? and what if I have more than one methods, say one with return value and one without return value, can I use same gateway or I need one gateway per method? many thanks

    public Pojo
    {
    private Gateway gateWay;

    public void setGateway(Gateway gateWay)
    {
    this.gateWay = gateWay;
    }

    public Object methodA(String A)
    {
    return this.gateWay().methodA(A);
    }

    public void methodB(String B)
    {
    this.gateWay().methodA(B);
    }

    }

  • #2
    Yes this is correct.
    As far as multiple methods, personally I would not recommend that . . . it never feels right to me to have a Messaging gateway (singular concept) that exposes multiple entry points to a Messaging system.
    Having said that you can still do it rather simply via <int:method. . .> mappings.
    You can read more here: http://static.springsource.org/sprin...on-annotations

    Comment


    • #3
      Thank you very much. And what's the difference between default-reply-channel/default-request-channel and reply-channel/request-channel in the gateway? Right now i'm using the default-request/reply in the configs

      Comment


      • #4
        Please go thru documentation, its all explained there and let us know if something is not clear and we'll update it.

        Comment

        Working...
        X