JMS Component

Ref:https://camel.apache.org/components/latest/jms-component.html

支持Consumer和Producer。

终结点:JMS的queue或者topic。兼容JmsTemplate。

在camel-jms,camel-jms-starter依赖中找到。

URI:jms:[queue:|topic:]destinationName[?options]

  • Where destinationName is a JMS queue or topic name. By default, the destinationName is interpreted as a queue name。默认是队列名称。

影响性能的因素:缓存和事务。

接收和发送:

from("jms:queue:foo").
   to("bean:myBusinessLogic");

from("jms:topic:OrdersTopic").
  filter().method("myBean", "isGoldCustomer").
  to("jms:queue:BigSpendersQueue");

from("file://orders").
  convertBodyTo(String.class).
  to("jms:topic:OrdersTopic");

//死信队列
errorHandler(deadLetterChannel("jms:queue:dead?transferExchange=true"));

from("jms:queue:dead").to("bean:myErrorAnalyzer");

// and in our bean
String body = exchange.getIn().getBody();
Exception cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class);
// the cause message is
String problem = cause.getMessage();

TODO:各种机制。

results matching ""

    No results matching ""