Camel SMPP - Server
Asked Answered
H

1

10

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 ?

Huberman answered 9/12, 2013 at 10:10 Comment(3)
do u have a list of these clients. what I mean to ask is if you have such list before accepting request, it might be achievable.Shoot
I don't have the list of clientsHuberman
i have some solutions that i can share but from where you fetch dynamic clients? request, database or what ?Hydroponics
G
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://[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.

Gondola answered 16/12, 2013 at 8:44 Comment(5)
As mentioned in the question, I don't have the list of Senders. how will i configure the fromHuberman
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?Gondola
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.Gondola
Yes.. question is about camel acting as server.Huberman
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.Gondola

© 2022 - 2024 — McMap. All rights reserved.