-
Oct 7th, 2012, 07:33 PM
#1
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);
}
}
-
Oct 8th, 2012, 08:20 AM
#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
-
Oct 8th, 2012, 09:16 AM
#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
-
Oct 8th, 2012, 09:20 AM
#4
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
-
Forum Rules