How to use AMQP with Active MQ in Mule -



How to use AMQP with Active MQ in Mule -

hi working mule point studio. want define 1 queue name , queue want read info using amqp. not polling info queue mentioned.

my mule flow: <amqp:connector name="amqpconnector" doc:name="amqp connector" host="localhost" port="5672" username="admin" password="admin" validateconnections="true" ></amqp:connector> <flow name="mule-ampq" doc:name="mule-ampq"> <amqp:inbound-endpoint exchangename="amqp.default.exchange" queuename="newx" queueautodelete="true" connector-ref="amqpconnector" doc:name="amqp" exchangetype="fanout" responsetimeout="10000"/> <logger message="#[message.payload]" level="info" doc:name="logger"/> </flow>

i getting next error:

error 2014-10-16 15:54:44,452 [main] org.mule.module.launcher.defaultarchivedeployer: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + failed deploy artifact 'mule-ampq', see below + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ org.mule.module.launcher.deploymentstartexception: eofexception: @ org.mule.module.launcher.application.defaultmuleapplication.start(defaultmuleapplication.java:143) @ org.mule.module.launcher.artifact.artifactwrapper$4.execute(artifactwrapper.java:98) @ org.mule.module.launcher.artifact.artifactwrapper.executewithinartifactclassloader(artifactwrapper.java:129) @ org.mule.module.launcher.artifact.artifactwrapper.start(artifactwrapper.java:93) @ org.mule.module.launcher.defaultartifactdeployer.deploy(defaultartifactdeployer.java:26) @ org.mule.module.launcher.defaultarchivedeployer.guardeddeploy(defaultarchivedeployer.java:274) @ org.mule.module.launcher.defaultarchivedeployer.deployartifact(defaultarchivedeployer.java:294) @ org.mule.module.launcher.defaultarchivedeployer.deployexplodedapp(defaultarchivedeployer.java:261) @ org.mule.module.launcher.defaultarchivedeployer.deployexplodedartifact(defaultarchivedeployer.java:110) @ org.mule.module.launcher.deploymentdirectorywatcher.deployexplodedapps(deploymentdirectorywatcher.java:287) @ org.mule.module.launcher.deploymentdirectorywatcher.start(deploymentdirectorywatcher.java:148) @ org.mule.tooling.server.application.applicationdeployer.main(applicationdeployer.java:130) caused by: org.mule.retry.retrypolicyexhaustedexception: null @ org.mule.retry.policies.abstractpolicytemplate.execute(abstractpolicytemplate.java:101) @ org.mule.transport.abstractconnector.connect(abstractconnector.java:1621) @ org.mule.transport.abstractconnector.start(abstractconnector.java:424) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.mule.lifecycle.phases.defaultlifecyclephase.applylifecycle(defaultlifecyclephase.java:237) @ org.mule.lifecycle.registrylifecyclemanager$registrylifecyclecallback.ontransition(registrylifecyclemanager.java:273) @ org.mule.lifecycle.registrylifecyclemanager.invokephase(registrylifecyclemanager.java:152) @ org.mule.lifecycle.registrylifecyclemanager.firelifecycle(registrylifecyclemanager.java:123) @ org.mule.registry.abstractregistrybroker.firelifecycle(abstractregistrybroker.java:76) @ org.mule.registry.muleregistryhelper.firelifecycle(muleregistryhelper.java:136) @ org.mule.lifecycle.mulecontextlifecyclemanager$mulecontextlifecyclecallback.ontransition(mulecontextlifecyclemanager.java:91) @ org.mule.lifecycle.mulecontextlifecyclemanager$mulecontextlifecyclecallback.ontransition(mulecontextlifecyclemanager.java:87) @ org.mule.lifecycle.mulecontextlifecyclemanager.invokephase(mulecontextlifecyclemanager.java:69) @ org.mule.lifecycle.mulecontextlifecyclemanager.firelifecycle(mulecontextlifecyclemanager.java:61) @ org.mule.defaultmulecontext.start(defaultmulecontext.java:278) @ org.mule.module.launcher.application.defaultmuleapplication.start(defaultmuleapplication.java:123) ... 11 more caused by: java.io.ioexception @ com.rabbitmq.client.impl.amqchannel.wrap(amqchannel.java:107) @ com.rabbitmq.client.impl.amqconnection.start(amqconnection.java:259) @ com.rabbitmq.client.connectionfactory.newconnection(connectionfactory.java:383) @ com.rabbitmq.client.connectionfactory.newconnection(connectionfactory.java:403) @ org.mule.transport.amqp.amqpconnector.connecttofirstresponsivebroker(amqpconnector.java:443) @ org.mule.transport.amqp.amqpconnector.doconnect(amqpconnector.java:365) @ org.mule.transport.abstractconnector$5.dowork(abstractconnector.java:1561) @ org.mule.retry.policies.abstractpolicytemplate.execute(abstractpolicytemplate.java:63) ... 29 more caused by: com.rabbitmq.client.shutdownsignalexception: connection error; reason: java.io.eofexception @ com.rabbitmq.utility.valueorexception.getvalue(valueorexception.java:67) @ com.rabbitmq.utility.blockingvalueorexception.uninterruptiblegetvalue(blockingvalueorexception.java:33) @ com.rabbitmq.client.impl.amqchannel$blockingrpccontinuation.getreply(amqchannel.java:328) @ com.rabbitmq.client.impl.amqconnection.start(amqconnection.java:244) ... 35 more caused by: java.io.eofexception @ java.io.datainputstream.readunsignedbyte(datainputstream.java:290) @ com.rabbitmq.client.impl.frame.readfrom(frame.java:104) @ com.rabbitmq.client.impl.socketframehandler.readframe(socketframehandler.java:141) @ com.rabbitmq.client.impl.amqconnection.readframe(amqconnection.java:402) @ com.rabbitmq.client.impl.amqconnection$mainloop.run(amqconnection.java:430) info 2014-10-16 15:54:44,455 [main] org.mule.module.launcher.deploymentdirectorywatcher: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + mule , kicking (every 5000ms) + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

try illustration ... contains different different exchange type used amqp .. direct messaging don't need create queue explicitly in rabitmq.. automatically created :-

<http:connector name="httpconnector" doc:name="http\https"/> <amqp:connector name="amqpconnector" activedeclarationsonly="true" ackmode="mule_auto" doc:name="amqp connector"/> <amqp:connector name="amqpconnectormanualack" prefetchcount="1" ackmode="manual" doc:name="amqp connector"/> <amqp:connector name="mandatoryamqpconnector" mandatory="true" immediate="true" doc:name="amqp connector"/> <!-- direct messaging --> <amqp:connector name="amqp_config" validateconnections="true" virtualhost="/" username="guest" password="guest" doc:name="amqp connector"/> <amqp:endpoint exchangename="directex" queuename="directq" routingkey="routing.key" exchangetype="direct" queuedurable="true" name="amqp_direct_endpoint" responsetimeout="10000" doc:name="amqp"/> <!-- direct messaging --> <jbossts:transaction-manager doc:name="transaction manager"> <property key="com.arjuna.ats.arjuna.coordinator.defaulttimeout" value="600"></property> <property key="com.arjuna.ats.arjuna.coordinator.txreapertimeout" value="1000000"></property> </jbossts:transaction-manager> <flow name="defaultsender" doc:name="defaultsender" > <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="1080" path="orders" doc:name="/orders" doc:description="process http reqests or responses." connector-ref="httpconnector"/> <set-payload value="new message flow1" doc:name="set payload"/> <logger message="sending message queue inhouseorder .. payload #[message.payload]" level="info" category="defaultsender" doc:name="payload logger" /> <amqp:outbound-endpoint exchange-pattern="request-response" exchangename="directex" exchangetype="direct" queuedurable="true" queuename="inhouseorder" connector-ref="amqpconnector" doc:name="dispatch inhouseorder" /> <byte-array-to-object-transformer doc:name="byte array object"/> </flow> <flow name="defaultreceiver" doc:name="inhouseorder" processingstrategy="synchronous" > <amqp:inbound-endpoint queuename="inhouseorder" connector-ref="amqpconnector" exchangename="directex" exchangetype="direct" queuedurable="true" doc:name="inhouseorder" > <amqp:transaction action="always_begin" recoverstrategy="requeue" /> </amqp:inbound-endpoint> <byte-array-to-object-transformer doc:name="byte array object"/> <logger message="receiving message queue inhouseorder .. payload #[message.payload]" level="info" category="defaultreceiver" doc:name="payload logger" /> </flow> <flow name="fanoutsenderexample2" doc:name="fanoutsenderexample2"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="1080" path="orders3" doc:name="/orders" doc:description="process http reqests or responses." connector-ref="httpconnector"/> <set-payload value="fanout message queue accounting" doc:name="set payload"/> <logger message="sending payload in fanoutsenderexample2 #[message.payload]" level="info" category="fanoutsenderexample2" doc:name="payload logger" /> <amqp:outbound-endpoint exchangename="back-end-processing" exchangetype="fanout" exchangeautodelete="false" exchangedurable="true" queuedurable="true" queueexclusive="false" queueautodelete="false" exchange-pattern="one-way" connector-ref="amqpconnector" doc:name="dispatch back-end-processing" /> <byte-array-to-object-transformer doc:name="byte array object"/> </flow> <flow name="fanoutreceiverexample2" doc:name="fanoutreceiverexample2"> <amqp:inbound-endpoint exchangename="back-end-processing" queuename="accounting" exchangetype="fanout" exchangeautodelete="false" exchangedurable="true" queuedurable="true" queueexclusive="false" queueautodelete="false" connector-ref="amqpconnector" doc:name="back-end-processing fullfilment queue" /> <byte-array-to-object-transformer doc:name="byte array object"/> <logger message="payload received in fanoutreceiverexample2 is: #[payload]" level="info" category="fanoutreceiverexample2" doc:name="payload logger" /> </flow> <!-- direct messaging --> <flow name="send_message_direct" doc:name="send_message_direct"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="1080" doc:name="http" path="orders5"/> <set-payload value="#['im direct message'.getbytes()]" doc:name="set payload amqp message bytearray"/> <amqp:outbound-endpoint responsetimeout="10000" doc:name="send direct message" connector-ref="amqp_config" ref="amqp_direct_endpoint"/> <set-payload value="#['message sended']" doc:name="set payload string"/> <logger message="direct message sended" level="info" doc:name="logger"/> </flow> <flow name="recive_message_direct" doc:name="recive_message_direct"> <amqp:inbound-endpoint responsetimeout="10000" doc:name="recive direct message" connector-ref="amqp_config" ref="amqp_direct_endpoint"/> <byte-array-to-string-transformer doc:name="transform bytearray message string"/> <logger message="i recived direct message amqp: #[payload]" level="info" doc:name="logger"/> </flow> <sub-flow name="defaulterrorhandler" doc:name="defaulterrorhandler"> <logger message="error occurred: #[payload]" level="info" doc:name="log error"/> <smtp:outbound-endpoint host="localhost" responsetimeout="10000" doc:name="send email operations"/> </sub-flow> </mule>

reference :- reference :- https://github.com/mulesoft/mule-transport-amqp/blob/master/guide.md#mule-amqp-transport---user-guide

mule amqp mule-studio mule-el mule-component

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -