9

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://smppclient@127.0.0.1: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 ?

рüффп
  • 4,475
  • 34
  • 62
  • 99
Joe2013
  • 947
  • 7
  • 22

1 Answers1

0

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://smppclient@127.0.0.1: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://smppclient@127.0.0.1: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.

Milan Baran
  • 3,918
  • 2
  • 27
  • 47
  • As mentioned in the question, I don't have the list of Senders. how will i configure the from – Joe2013 Dec 18 '13 at 04:29
  • Ahh, so, you do not want to configure all your clients in Camel and pull all requests from smppclient. But you want to push requests from smppclient to generic camel smpp receiver. So, you do not need to configure from node for each client. Am i right? – Milan Baran Dec 18 '13 at 10:21
  • The question is whether you smppclient is able to push or connect to your camel generic server. Otherwise I can't imagine how to configure such a thing. – Milan Baran Dec 19 '13 at 10:11
  • Yes.. question is about camel acting as server. – Joe2013 Dec 20 '13 at 10:56
  • You can use Netty or Mina component to expose a port to communicate with. As I said, the question is whether you smppclient is able to connect to your camel server. There is also a simple way how to put messages to camel and that is to use files or jms. In first case your smppclient will produce a file into specific folder and camel will consume it. In second case you will need some kind of MQ (ActiveMQ) and smppclient will put message to queue and camel will consume these messages from the queue. – Milan Baran Dec 20 '13 at 11:49