apache-camel - Camel SMPP - 服务器

标签 apache-camel jbossfuse fuseesb apache-servicemix jsmpp

我熟悉 Camel-SMPP,它也适用于我的消费者和生产者路线。我正在使用 Selenium SMPP SIM 进行测试。

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

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

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

最佳答案

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

  • 127.0.0.1:8056 为 短信客户端
  • 本地主机:2775 为 短信发件人

  • 它看起来像这样
    from:client1 ----> to:sender1
    

    假设您想连接更多 短信客户端给您的 短信发件人 .
    from:client1 -----> to:sender1
    from:client2 ----/
    from:client3 ---/
    

    您需要做的就是添加更多 来自 节点。

    我认为您正在使用 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 ---/
    

    所以你的代码将是:
    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"/>
    

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

    关于apache-camel - Camel SMPP - 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20467904/

    相关文章:

    apache-camel - Camel File Endpoint - 获取文件名

    apache-camel - 仅在 Camel route 使用 direct-vm 请求消息传递

    java - 在 JBoss Fuse 6.2 中使用 ensemble-add 时,角色/凭据不足,无法进行操作

    java - Fabric8(Fuse ESB 6.1)基于功能部署配置文件的策略

    http - 如何在使用 camel-http 时设置代理

    java - Camel发送多条消息,消息仍未提交。如何 promise

    xml - Camel xml 到 xml 转换 xslt 仍然是可行的方法吗?

    java - Apache Camel - 从主体中获取属性值

    java - 如何在 JBoss Fuse 蓝图中使用多个属性占位符?

    ruby-on-rails - FUSE ESB 支持 RabbitMQ 吗?