Camel SMPP - Server

1.6k views Asked by At

I am familiar with Camel-SMPP and also it works great for my consumer and producer routes. I am using Selenium SMPP SIM to test the same.

from uri="smpp://[email protected]:8056?password=password&systemType=consumer"/>

to uri="smpp://smppclient@localhost:2775?password=password&&systemType=producer"/>

However I would like to have my Camel run as a Server (which accepts SMS from numerous clients). My current From route is tightly coupled with one SMS sender. How can I modify this as generic server. Is it possible in Camel ?

1

There are 1 answers

5
Milan Baran On

if I understand you question right, you have:

  • 127.0.0.1:8056 as SMS client
  • localhost:2775 as SMS sender

it looks like this

from:client1 ----> to:sender1

lets say you want to connecto more SMS clients to your SMS sender.

from:client1 -----> to:sender1
from:client2 ----/
from:client3 ---/

All you need to make is to add more from nodes.

I think you are using springish xml file to configure Camel. It means you do it in declarative way and camel does as much as you declare in you xml file. No for loops or something. So, literaly you need to add more from uri="smpp://[email protected]:8056?password=password&systemType=consumer"/> lines into your xml. In other way you can use camel java API to configre/add your nodes dynamically. So, you could configure or add your nodes from DB or whatsoever.

Well, but you have to add as much to uri="smpp://smppclient@localhost:2775?password=password&&systemType=producer"/> nodes which is not exactly what we meant. To fix this, we add a abstraction node between. It will look like:

from:client1 -----> direct:sender ----> to:sender1
from:client2 ----/
from:client3 ---/

So your code will be:

from uri="smpp://[email protected]:8056?password=password&systemType=consumer"/>
to uri="direct://sender"
from uri="smpp://smppclient2@...."/>
to uri="direct://sender"
from uri="smpp://smppclient3@..."/>
to uri="direct://sender"

from uri="direct://sender"
to uri="smpp://smppclient@localhost:2775?password=password&&systemType=producer"/>

You can consider to use seda instead of direct so you get queuing quite easily.