I have some questions because documentation is not clear..
How should I setup WSO2 ESB environment to be able to read and write messages form WSO2 MessageBroker.
I followed ConfigurewithWSO2MessageBroker
I have ESB and MB on same server (MB has Offset=2)
/repository/conf/axis2/axis2.xml
....
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="JMSTopic" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
</parameter>
<parameter name="JMSQueue" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>
<parameter name="default" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>
</transportReceiver>
...
and sender part
<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender">
<parameter name="default" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">ConnectionFactory</parameter>
</parameter>
</transportSender>
jndi.properties files
connectionfactory.QueueConnectionFactory = amqp://admin:admin#clientID/carbon?brokerlist='tcp://gst-esb-qa-01:5674'
connectionfactory.TopicConnectionFactory = amqp://admin:admin#clientID/carbon?brokerlist='tcp://gst-esb-qa-01:5674'
connectionfactory.ConnectionFactory = amqp://admin:admin#clientID/carbon?brokerlist='tcp://gst-esb-qa-01:5674'
queue.myQueue = myQueue
queue.testQueue= testQueue
topic.MyTopic = MyTopic
My proxy
<proxy name="SendMessagetoJMSProxy" transports="http" startOnLoad="true">
<target>
<endpoint>
<address uri="jms:/myQueue?&transport.jms.DestinationType=queue"/>
</endpoint>
<inSequence>
<log level="custom">
<property name="STATE" value="message is sent to queue"/>
</log>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
</inSequence>
<outSequence/>
</target>
</proxy>
my SOAP UI call
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">
<soapenv:Header/>
<soapenv:Body>
<ser:dummy>
<xsd:symbol>IBM</xsd:symbol>
</ser:dummy>
</soapenv:Body>
</soapenv:Envelope>
According to doc I should see the message in JMS Message Broker BUT I get
Error while building Passthrough stream
TID[-1234] [ESB] [2017-05-16 12:52:47,137] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} - Error while building Passthrough stream org.apache.axiom.om.impl.builder.StAXOMBuilder.lookahead(StAXOMBuilder.java:711) org.apache.axiom.soap.impl.llom.SOAPBodyImpl.hasLookahead(SOAPBodyImpl.java:191) org.apache.axiom.soap.impl.llom.SOAPBodyImpl.getFirstElementLocalName(SOAPBodyImpl.java:217) org.apache.axiom.soap.impl.llom.SOAPBodyImpl.hasFault(SOAPBodyImpl.java:99) org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.hasFault(SOAPEnvelopeImpl.java:305) org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:189) org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:137) org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:100) org.apache.synapse.mediators.AbstractListMediator.buildMessage(AbstractListMediator.java:140) org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:83) org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59) org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158) org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:210) org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:403) org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151) org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745)
AND
Endpoint : AnonymousEndpoint with address jms:/myQueue?&transport.jms.DestinationType=queue will be marked SUSPENDED as it failed
First question :
java.naming.provider.url param in axis2.xml is it relative to [ESB Home] location ?
Im my case server folder structure looks like ...
maybe that should look like ....????
<parameter name="java.naming.provider.url" locked="false">file:/home/wso2admin/wso2esb-5.0.0/repository/conf/jndi.properties</parameter>
SECOND :
is this error related to Message Builder and Formater ????
any help would be nice ...couse Im stuck for days ...
First Question:java.naming.provider.url param in axis2.xml is it relative to [ESB Home] location ?
No, you dont need to add ESB home location.
Second Question: is this error related to Message Builder and Formater ????
Yes, you are getting an error with message builders.
Just verify whether you added client jars and verify your proxy. Please create a proxy as follow and try it.
Sample Proxy:
<proxy name="QueueProxy" startOnLoad="true" transports="jms">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<send>
<endpoint>
<address uri="jms:/MyQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties"/>
</endpoint>
</send>
</inSequence>
</target>
</proxy>
Reference: https://docs.wso2.com/display/ESB500/ESB+as+a+JMS+Producer
Please try the below proxy and check the URL format you are using
<proxy xmlns="http://ws.apache.org/ns/synapse" name="StockQuoteProxy" transports="http">
<target>
<inSequence>
<property action="set" name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="jms:/myQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
for more
https://docs.wso2.com/display/ESB500/ESB+as+a+JMS+Producer
https://docs.wso2.com/display/MB310/Integrating+WSO2+ESB
Thanks to Rajjaz and Jan ...
I created a proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="SendMessagetoJMSProxy"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<log level="custom">
<property name="STATE" value="message is sent to myQueue"/>
</log>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
</inSequence>
<outSequence/>
<endpoint>
<address uri="jms:/myQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties"/>
</endpoint>
</target>
<description/>
</proxy>
also I figure out that if you have define default JMS configuration part in axis2.xml for transportReceiver it is enough to put name of Queue
so this is also working
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="SendMessagetoJMSProxy2"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<log level="custom">
<property name="STATE" value="message is sent to GST_TMS_ASSOCIATE_LEASE Queue"/>
</log>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
</inSequence>
<outSequence/>
<endpoint>
<address uri="jms:/myQueue"/>
</endpoint>
</target>
<description/>
</proxy>
and now I can publish a message to JMS queue with proxy ...
Im little confused (still) where all this log in System logs coming from and why ?!?]1
Related
Issue: i have a proxy service which consumes only XML message, but sometimes if we are getting XML message with not proper format,just syntax error,our proxy should send that message to a different queue,the message should not loss.
i have followed the below link but unable to get the expected output
https://www.yenlo.com/blog/guaranteed-message-deliveries-part-3-monitoring-the-redelivery-policy
Below is my proxy:
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="RollbackProxy" startOnLoad="true" transports="jms" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<log description="" level="full">
<property name="****************" value="******************************"/>
</log>
</inSequence>
<outSequence/>
<faultSequence>
<property name="SET_ROLLBACK_ONLY" scope="axis2" type="STRING" value="true"/>
<log category="ERROR" level="full">
<property expression="$ctx:ERROR_CODE" name="error_code"/>
<property expression="$ctx:ERROR_MESSAGE" name="error_message"/>
<property expression="$ctx:ERROR_DETAIL" name="error_detail"/>
</log>
</faultSequence>
</target>
<parameter name="transport.jms.Destination">QueueName</parameter>
<parameter name="transport.jms.ContentType">
<rules xmlns="">
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
<parameter name="transport.jms.ConnectionFactory">myQueueConnectionFactory</parameter>
</proxy>
axis2.xml and activemq.xml i have properly updated.
we are using active MQ.
Can somebody guide me on this?
Thanks in Advance
I am trying to send an email from the WSO2 ESB and configured as per one wos2 blog. I am getting error " MailTransportListener Checking mail for account : synapse.demo.1#gmail.com". I a not sure what is wrong in code and can I also send am email on my personal email id so that I can come to know that everything is working fine.
Synapse Code:
<proxy name="StockQuoteProxy" transports="mailto">
<parameter name="transport.mail.Address">synapse.demo.1#gmail.com</parameter>
<parameter name="transport.mail.Protocol">pop3</parameter>
<parameter name="transport.PollInterval">5</parameter>
<parameter name="mail.pop3.host">pop.gmail.com</parameter>
<parameter name="mail.pop3.port">995</parameter>
<parameter name="mail.pop3.user">synapse.demo.1</parameter>
<parameter name="mail.pop3.password">mailpassword</parameter>
<parameter name="mail.pop3.socketFactory.class">javax.net.ssl.SSLSocketFactory</parameter>
<parameter name="mail.pop3.socketFactory.fallback">false</parameter>
<parameter name="mail.pop3.socketFactory.port">995</parameter>
<parameter name="transport.mail.ContentType">application/xml</parameter>
<target>
<inSequence>
<property name="senderAddress" expression="get-property('transport', 'From')"/>
<log level="full">
<property name="Sender Address" expression="get-property('senderAddress')"/>
</log>
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<property name="Subject" value="Custom Subject for Response" scope="transport"/>
<property name="messageType" value="text/plain" scope="axis2-client"/>
<script language="js"><![CDATA[
mc.setPayloadXML(<ns:text xmlns:ns="http://ws.apache.org/commons/ns/payload">Plain text received!</ns:text>);
]]></script>
<header name="To" expression="fn:concat('mailto:', get-property('senderAddress'))"/>
<log level="full">
<property name="message" value="Response message"/>
<property name="Sender Address" expression="get-property('senderAddress')"/>
</log>
<send/>
</outSequence>
</target>
<publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
Thanks for your response. All I want is to send an email once I hit this service. my new code is :
<proxy name="SendEmailService" transports="http" startOnLoad="true" statistics="enable" trace="disable">
<target inSequence="SendEmailService_IN" />
<publishWSDL key="SendEmailService_wsdl"/>
</proxy>
<localEntry key="SendEmailService_wsdl" src="file:repository/conf/employee/OverseaseEmployee.wsdl"/>
<sequence name="SendEmailService_IN">
<property name="Subject" value="Custom Subject for Response" scope="transport"/>
<property name="ContentType" value="text/plain" scope="axis2"/>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
<send>
<endpoint>
<address uri="06.shrikant#gmail.com"/>
</endpoint>
</send>
<parameter name="mail.smtp.user">shrikant</parameter>
<parameter name="transport.mail.Protocol">smtp</parameter>
<parameter name="transport.mail.Address">06.shrikant#gmail.com</parameter>
<parameter name="mail.smtp.port">587</parameter>
<parameter name="mail.smtp.password">pass</parameter>
<parameter name="transport.mail.ContentType">text/plain</parameter>
<parameter name="mail.smtp.starttls.enable">true</parameter>
<parameter name="mail.smtp.auth">true</parameter>
<parameter name="mail.smtp.from">06.shrikant#gmail.com</parameter>
<parameter name="mail.smtp.host">smtp.gmail.com</parameter>
<send/>
</sequence>
Here is a working proxy to call a service and send the response to an email address. Here, transports="http,https" should be changed depending on how you want to call the proxy service.
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="MyPxy"
transports="http,https"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<send>
<endpoint>
<address uri="http://www.mocky.io/v2/57cd173e1200008620bb7826"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<property name="Subject"
value="Custom Subject for Response"
scope="transport"/>
<property name="ContentType" value="text/plain" scope="axis2"/>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
<send>
<endpoint>
<address uri="mailto:toemailuser#gmail.com"/>
</endpoint>
</send>
<respond/>
</outSequence>
</target>
<parameter name="mail.smtp.user">fromemailuser</parameter>
<parameter name="transport.mail.Protocol">smtp</parameter>
<parameter name="transport.mail.Address">fromemailuser#gmail.com</parameter>
<parameter name="mail.smtp.port">587</parameter>
<parameter name="mail.smtp.password">pass</parameter>
<parameter name="transport.mail.ContentType">text/plain</parameter>
<parameter name="mail.smtp.starttls.enable">true</parameter>
<parameter name="mail.smtp.auth">true</parameter>
<parameter name="mail.smtp.from">fromemailuser#gmail.com</parameter>
<parameter name="mail.smtp.host">smtp.gmail.com</parameter>
<description/>
</proxy>
You can refer this blog for sending email with wso2 esb http://elilsivanesan.blogspot.com/2016/06/mail-transport-with-wso2-esb.html
<?xml version="1.0" encoding="UTF-8" ?>
<proxy name="VFS_RTDB_Proxy" serviceGroup="" startOnLoad="true" trace="enable" transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<payloadFactory media-type="json">
<format>{rtdatas:$1}</format>
<args>
<arg expression="get-property('rtDataSets')" />
</args>
</payloadFactory>
<send>
<endpoint>
<address format="rest" statistics="enable" trace="enable" uri="http://211.154.164.28:9666/services/oge/vzdb/post/history" />
</endpoint>
</send>
</inSequence>
</target>
<parameter name="transport.vfs.Streaming">true</parameter>
<parameter name="transport.PollInterval">2</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.ActionAfterProces">MOVE</parameter>
<parameter name="transport.vfs.FileURI">D:\exportRTDB</parameter>
<parameter name="transport.vfs.FileURI">G:\MoveAfterFailure</parameter>
<parameter name="transport.vfs.MoveAfterFailure">G:\MoveAfterFailure</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.csv</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
</proxy>
Why does Send Mediator not execute? When I set Address Endpoint wrapped in Call Mediator, this doesn't execute either. How can I solve this?
When wrapped in Call Mediator, I get follow error:
[2016-03-30 20:31:25,550] INFO - BuilderUtil OMException in
getSOAPBuilder org.apache.axiom.soap.SOAPProcessingException: First
Element must contain the local name, Envelope , but found html
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:305)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:252)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:234)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(StAXSOAPModelBuilder.java:154)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(StAXSOAPModelBuilder.java:140)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:659)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:206)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:146)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:109)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:68)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:348)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:445)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.sendReceive(BlockingMsgSender.java:254)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.send(BlockingMsgSender.java:175)
at org.apache.synapse.mediators.builtin.CallMediator.handleBlockingCall(CallMediator.java:113)
at org.apache.synapse.mediators.builtin.CallMediator.mediate(CallMediator.java:85)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:149)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:185)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.axis2.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:328)
at org.apache.synapse.transport.vfs.VFSTransportListener.processFile(VFSTransportListener.java:751)
at org.apache.synapse.transport.vfs.VFSTransportListener.scanFileOrDirectory(VFSTransportListener.java:407)
at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:177)
at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:124)
at org.apache.axis2.transport.base.AbstractPollingTransportListener$1$1.run(AbstractPollingTransportListener.java:67)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745) [2016-03-30 20:31:25,635] INFO - BuilderUtil Remaining input stream :[]
[2016-03-30 20:31:25,635] WARN - FaultHandler ERROR_CODE : 401000
[2016-03-30 20:31:25,651] WARN - FaultHandler ERROR_MESSAGE : First
Element must contain the local name, Envelope , but found html
[2016-03-30 20:31:25,651] WARN - FaultHandler ERROR_DETAIL :
[2016-03-30 20:31:25,651] WARN - FaultHandler ERROR_EXCEPTION :
org.apache.synapse.SynapseException: Error while performing the call
operation [2016-03-30 20:31:25,651] WARN - FaultHandler FaultHandler
: org.apache.synapse.mediators.MediatorFaultHandler#4207ac5d
[2016-03-30 20:31:25,651] WARN - MediatorFaultHandler Executing fault
handler mediator : org.apache.synapse.mediators.base.SequenceMediator
The follow is changed proxy config, Get error By follow config;I have not publish proxy as WSDL,so I did not found web Page....
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="VFS_RTDB_Proxy" serviceGroup="" startOnLoad="true"
trace="enable" transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
<localEntry key="smooks-key" src="file:repository/samples/resources/smooks/smooks-config.xml"/>
<target>
<inSequence>
<class description="" name="cn.oge.kdm.mediator.RTDataSetMediator"/>
<!-- <log description="" level="custom">
<property expression="get-property('rtDataSets')" name="RTDATASET"/>
</log> -->
<payloadFactory media-type="json">
<format>{"rtdatas":$1}</format>
<args>
<arg expression="get-property('rtDataSets')"/>
</args>
</payloadFactory>
<call blocking="true">
<endpoint>
<address statistics="enable" trace="enable" uri="http://211.154.164.98:9766/services/oge/vzdb/post/history"/>
</endpoint>
</call>
</inSequence>
<outSequence>
<!-- <log level="full"/> -->
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<property
expression="fn:concat(fn:substring-after(get-property('MessageID'), 'urn:uuid:'), '.xml')"
name="transport.vfs.ReplyFileName" scope="transport" type="STRING"/>
</outSequence>
<faultSequence>
<!-- <class description="" name="cn.oge.kdm.mediator.DecompressionMediator"/> -->
<log level="full"/>
</faultSequence>
</target>
<parameter name="transport.vfs.Streaming">true</parameter>
<parameter name="transport.PollInterval">2</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.ActionAfterProces">MOVE</parameter>
<parameter name="transport.vfs.FileURI">D:\exportRTDB</parameter>
<parameter name="transport.vfs.MoveAfterProcess">vfs:ftp://ProEditor:****#211.154.164.99/</parameter>
<parameter name="transport.vfs.MoveAfterFailure">G:\MoveAfterFailure</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.csv</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
</proxy>
i am working with wso2esb 4.7.0 and ActiveMQ5.8.0 whenever i am working with wso2esb4.6.0 and ActiveMQ5.5.1 its working fine i am publishing my configuration below any one help for this
message store
<messageStore xmlns="http://ws.apache.org/ns/synapse"
class="org.wso2.carbon.message.store.persistence.jms.JMSMessageStore"
name="JMSQueue">
<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
<parameter name="store.jms.cache.connection">false</parameter>
<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
<parameter name="store.jms.JMSSpecVersion">1.1</parameter>
<parameter name="store.jms.destination">JMS_Reading_Queue</parameter>
</messageStore>
message processor
<messageProcessor xmlns="http://ws.apache.org/ns/synapse"
class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor"
name="faisal"
messageStore="JMSQueue">
<parameter name="max.delivery.attempts">4</parameter>
<parameter name="interval">1000</parameter>
</messageProcessor
and proxy is like this
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="Jms"
transports="https http jms"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<property name="messageType" value="application/json" scope="axis2"/>
<log level="full"/>
<store messageStore="JMSQueue"/>
<property name="target.endpoint"
value="JmsEndpoint"
scope="default"
type="STRING"/>
</inSequence>
<outSequence/>
</target>
</proxy>
and i defined my endpoint in endpoints
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="JmsEndpoint">
<address uri="http://192.168.1.122:8282/services/ReadingsMobile"
format="soap11"/>
</endpoint>
now i am getting no target endpoint errors same configuration working in wso2esb4.6.0 mbut not working in wso2esb4.7.0
and its giving errors like this
[2013-08-21 16:48:32,049] WARN - ForwardingHandler Property target.endpoint not found in the message context. Removing the message.
[2013-08-21 16:49:32,093] WARN - SourceHandler Connection time out after request is read: http-incoming-13
Try doing the below modifications in the proxy configuration in order to get rid of the warnings;
a) Replace < target > with < target endpoint="JmsEndpoint" >
b) Move the "store" tag entry after the property where you set the "target.endpoint".
These changes seem to do the trick in my environment. Check if it fixes your issue too.
Hope this helps.
Basically the error you are getting says message processor cannot find the target.endpoint property from the stored message context.
The reason for this is, you are storing the message before setting this property.
You have to set the 'target.endpoint' property before the store mediator in the flow.
Proxy configuration should look likes follows.
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="Jms"
transports="https http jms"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<property name="messageType" value="application/json" scope="axis2"/>
<log level="full"/>
<property name="target.endpoint"
value="JmsEndpoint"
scope="default"
type="STRING"/>
<store messageStore="JMSQueue"/>
</inSequence>
<outSequence/>
</target>
</proxy>
I have a proxy service in WSO2 ESB 4.5.0 that is supposed to handle a SOAP-request from a webclient, send information to a JMS-topic and then respond to the the webclient.
The problem is that when I use the JMS-sender it by default waits for a response on a temporary queue.
To change the behavior of the JMS-Sender I can set OUT_ONLY to true, but then the webclient does not get a response at all.
Is there a way to return a response even if I set OUT_ONLY to true?
OR
Can I set JMS-Sender not to expect a reply without sending OUT_ONLY to true?
According to your requirement you may need to use a Messagestore, please refer the following configuration, which stores the message in JMSStore and sending the acknowledgement back to the client (success or failed),followed by ESB uses the forward schedul processor which guarantees that the store message in the JMSStore will be delivered to the backend, and in the case of the real BE (may be JMS) failed it retires thus util the message is delivered thus it wont be removed from the Message store, this a part how the DEAD LATTER CHANNELING has been accomplished using WSO2 ESB
<proxy xmlns="http://ws.apache.org/ns/synapse" name="StockQuoteProxy" transports="http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
<property name="target.endpoint" value="JMSEP"/>
<property name="enableREST" value="true"/>
<store messageStore="JMSMS"/>
<payloadFactory>
<format>
<esbResponse xmlns="">
<text> added sccuessfully </text>
</esbResponse>
</format>
</payloadFactory>
<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<send/>
</inSequence>
<faultSequence>
<makefault version="soap11">
<code xmlns:soap11Env="http://schemas.xmlsoap.org/soap/envelope/" value="soap11Env:VersionMismatch"/>
<reason value="test"/>
<role>MessageStoreFault</role>
<detail>MessageStoreFault</detail>
</makefault>
<send/>
</faultSequence>
</target>
<publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
<description></description>
</proxy>
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="JMSEP">
<address uri="jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616" format="pox">
<suspendOnFailure>
<progressionFactor>1.0</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
<retryDelay>0</retryDelay>
</markForSuspension>
<timeout>
<duration>1000</duration>
<responseAction>fault</responseAction>
</timeout>
</address>
</endpoint>
<messageStore name="JMSMS" class="org.wso2.carbon.message.store.persistence.jms.JMSMessageStore" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
<parameter name="store.jms.destination">JMSMS</parameter>
<parameter name="store.jms.JMSSpecVersion">1.1</parameter>
<parameter name="store.jms.cache.connection">false</parameter>
</messageStore>
<messageProcessor name="Processor1" class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor" messageStore="JMSMS" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="interval">4000</parameter>
</messageProcessor>