0
sysAdminにメールを送信して、ルートに問題が生じ、DLQがいっぱいになっていることを通知する方法を見つけようとしています。電子メール通知を送信するようにDLQを設定できますか?
私は、次のコンポーネント/バージョンを備えたレガシーシステムに取り組んでいます:
- キャメル(v5.5.1)
- ActiveMQの(v2.8.5)
残念ながら、システムの所有者彼らは現在のバージョンにアップグレードしてはならないことを断言しています。私はここにそのうちの1つはcamel-context.xml
ファイル(自分のDLQとそれぞれ)、で定義された2つのルート...
<camelContext id="Bob-to-John" xmlns="http://camel.apache.org/schema/spring">
<jmxAgent id="agent" createConnector="true" registryPort="3333"/>
<!-- EXCEPTION HANDLING -->
<onException>
<exception>org.apache.camel.component.http.HttpOperationFailedException</exception>
<redeliveryPolicy maximumRedeliveries="5"/>
<handled> <constant>true</constant> </handled>
</onException>
<onException>
<exception>org.apache.camel.ValidationException</exception>
<redeliveryPolicy maximumRedeliveries="0"/>
<handled> <constant>true</constant> </handled>
</onException>
<!-- ROUTES -->
<route id="fromBob" autoStartup="true" errorHandlerRef="bobsDeadLetterErrorHandler" >
<!-- get data from Apache ActiveMQ -->
<from uri="mina:tcp://0.0.0.0:100?textline=true&disconnect=true&textlineDelimiter=UNIX&decoderMaxLineLength=1048576&encoding=UTF-8" />
<!-- make sure data is transferred in UTF-8 format -->
<convertBodyTo type="java.lang.String" charset="UTF-8" />
<!-- attempt to validate against Bob's XML schema -->
<to uri="validator:http://localhost/xsd/input.BOB.xsd" />
<!-- Bob to John transformation -->
<to uri="xslt:file:///home/xsl/bobToJohn.xsl" />
<setHeader headerName="CamelHttpMethod"> <constant>POST</constant> </setHeader>
<!-- send to John -->
<inOut uri="activemq:input.JOHN" />
</route>
<!-- DEAD LETTER CHANNELS -->
<bean id="bobsDeadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
<!-- exchanges are routed to activemq:failure.BOB in case redelivery failed -->
<property name="deadLetterUri" value="activemq:failure.BOB"/>
<!-- reference the redelivery policy to use -->
<property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig"/>
</bean>
<!-- lets configure the default ActiveMQ broker URL -->
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://localhost?broker.persistent=false&broker.useJmx=false"/>
</bean>
</property>
</bean>
<!-- configure the camel activemq component to use the current broker -->
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
<property name="userName" value="blahblah" />
<property name="password" value="ENC(mYRkg+4Quhua1kvpCCI2hg==)" />
</bean>
</property>
</bean>
<!-- Creating mina endpoints is a bit complex so we reuse MinaComponnet
as a factory bean to create our endpoint, this is the easiest to do -->
<bean id="mina" class="org.apache.camel.component.mina.MinaComponent">
<!-- we must provide a camel context so we refer to it by its id -->
<constructor-arg index="0" ref="BOB-to-JOHN" />
</bean>
を持って
は、私はこれを送信するためにDLQに追加することができるものはあります通知、またはこれは、このようなものの最新バージョンでのみ可能ですか?それとも、間違った場所を完全に探しているのですか?
私はhawt.ioを使って物を管理することも考えています。
うわー、この種のことはデフォルトではありません。私はこれが非常に役に立つと思っていたでしょう... –
オープンソースについての素晴らしいことはあなたが貢献できることです.... –