Camel SMPP - 服务器

Joe*_*013 8 apache-camel jsmpp fuseesb jbossfuse apache-servicemix

我熟悉Camel-SMPP,它对我的​​消费者和生产者路线也很有用.我正在使用Selenium SMPP SIM来测试它.

来自uri ="smpp://smppclient@127.0.0.1:8056?password = password&systemType = consumer"/>

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

但是,我想让我的Camel作为服务器运行(它接受来自众多客户的SMS).我当前的From路由与一个SMS发送器紧密耦合.如何将其修改为通用服务器.骆驼有可能吗?

Mil*_*ran 0

如果我理解你的问题是正确的,你有:

  • 127.0.0.1:8056 作为短信客户端
  • 本地主机:2775 作为短信发送者

看起来像这样

from:client1 ----> to:sender1
Run Code Online (Sandbox Code Playgroud)

假设您想将更多SMS 客户端连接到您的SMS 发送器

from:client1 -----> to:sender1
from:client2 ----/
from:client3 ---/
Run Code Online (Sandbox Code Playgroud)

您所需要做的就是从节点添加更多内容。

我认为您正在使用 springish xml 文件来配置 Camel。这意味着您以声明方式执行此操作,并且 Camel 执行的操作与您在 xml 文件中声明的操作一样多。没有for循环什么的。因此,实际上您需要from uri="smpp://smppclient@127.0.0.1:8056?password=password&systemType=consumer"/>在 xml 中添加更多行。以其他方式,您可以使用camel java API 动态配置/添加节点。因此,您可以从数据库或其他方式配置或添加节点。

好吧,但是您必须添加尽可能多的to uri="smpp://smppclient@localhost:2775?password=password&&systemType=producer"/>节点,这并不完全是我们的意思。为了解决这个问题,我们在之间添加了一个抽象节点。它看起来像:

from:client1 -----> direct:sender ----> to:sender1
from:client2 ----/
from:client3 ---/
Run Code Online (Sandbox Code Playgroud)

所以你的代码将是:

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"/>
Run Code Online (Sandbox Code Playgroud)

您可以考虑使用seda而不是这样direct您很容易排队。