Results 1 to 4 of 4

Thread: still question about gateway

  1. #1
    Join Date
    Feb 2010
    Posts
    15

    Default 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. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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

  3. #3
    Join Date
    Feb 2010
    Posts
    15

    Default

    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

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

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

Posting Permissions

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