Issue in implementing Guaranteed Delivery EIP using RabbitMQ

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue in implementing Guaranteed Delivery EIP using RabbitMQ

Piriya Sivalingam
Hi,

I am trying to implement guaranteed delivery EIP using WSO2ESB and WSO2DSS. My endpoint for this scenario is a dataservice in WSO2DSS. In this scenario, I am using RabbitMQ as the message broker. 

I followed the below steps to implement the guaranteed delivery scenario.
  • I installed RabbitMQ and Erlang OTP.
  • Then I added RabbitMQ message store according to the instructions in this [1] document.
  • I created an API with store mediator to stores messages using the above message store.
  • Then I created a Message-processor that consumes messages from the message-store and sends it to an endpoint.
Below are the configurations of the Message-Store, API and Message-Processor.

Message-Store:

<messageStore name="RabbitMS" class="org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="store.rabbitmq.host.name">localhost</parameter>
   <parameter name="store.rabbitmq.host.port">5672</parameter>
   <parameter name="store.rabbitmq.queue.name">RabbitMS_Queue</parameter>
   <parameter name="store.producer.guaranteed.delivery.enable">true</parameter>
   <parameter name="store.failover.message.store.name">InMemoryStore</parameter>
</messageStore>

API:

<api xmlns="http://ws.apache.org/ns/synapse" name="API1" context="/details">
   <resource methods="GET" url-mapping="/test">
      <inSequence>
         <payloadFactory media-type="xml">
            <format>
               <p:select_with_key_CHASSIS_operation xmlns:p="https://car.data.wso2.com">
                  <xs:CHASSIS_ID xmlns:xs="https://car.data.wso2.com">1009</xs:CHASSIS_ID>
               </p:select_with_key_CHASSIS_operation>
            </format>
            <args/>
         </payloadFactory>
         <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" type="STRING"/>
          <property name="OUT_ONLY" value="true" scope="default" type="STRING"></property>
         <log level="full"/>
         <store messageStore="RabbitMS"/>
      </inSequence>
   </resource>
</api>

Message-Processor:

<messageProcessor name="Forwarder" class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor" targetEndpoint="sampleEndPoint" messageStore="RabbitMS" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="interval">1000</parameter>
   <parameter name="client.retry.interval">1000</parameter>
   <parameter name="max.delivery.attempts">4</parameter>
   <parameter name="is.active">true</parameter>
   <parameter name="max.delivery.drop">Disabled</parameter>
   <parameter name="member.count">1</parameter>
</messageProcessor>

End-point:

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="sampleEndPoint">
      </address>
</endpoint>


But when I invoke the API with the below curl command I could not see any messages stored in the message-store/queue or any logs in the console of ESB. 

curl command:
curl -X GET -H "Content-Type:application/json" 'http://192.168.8.100:8280/details'

Could you please suggest whether what I have done is correct or correct me if I have done something wrong.


Thanks.
Piriya

--
Regards,
Piriya Sivalingam
Software Engineer - Support Team
WSO2
Mobile : +94 77 8462039

http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue in implementing Guaranteed Delivery EIP using RabbitMQ

Godwin Amila Shrimal
Hi Piriya,

I don't see any issue with what you have done here. You can't see messages in the store, may be due to message processor consume that message and trying to send to the endpoint. You can do following things to troubleshoot this issue.

1. Remove messageprocessor temporarily and execute the curl command, then the message should be there in the store. If the message is still not there, then there should be something wrong with message queue configurations. 

2. If you can see the message in store in step #1, there can be something wrong with the endpoint you provided. You can enable wire log and troubleshoot that.

Thanks
Godwin


On Thu, Dec 28, 2017 at 10:47 PM, Piriya Sivalingam <[hidden email]> wrote:
Hi,

I am trying to implement guaranteed delivery EIP using WSO2ESB and WSO2DSS. My endpoint for this scenario is a dataservice in WSO2DSS. In this scenario, I am using RabbitMQ as the message broker. 

I followed the below steps to implement the guaranteed delivery scenario.
  • I installed RabbitMQ and Erlang OTP.
  • Then I added RabbitMQ message store according to the instructions in this [1] document.
  • I created an API with store mediator to stores messages using the above message store.
  • Then I created a Message-processor that consumes messages from the message-store and sends it to an endpoint.
Below are the configurations of the Message-Store, API and Message-Processor.

Message-Store:

<messageStore name="RabbitMS" class="org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="store.rabbitmq.host.name">localhost</parameter>
   <parameter name="store.rabbitmq.host.port">5672</parameter>
   <parameter name="store.rabbitmq.queue.name">RabbitMS_Queue</parameter>
   <parameter name="store.producer.guaranteed.delivery.enable">true</parameter>
   <parameter name="store.failover.message.store.name">InMemoryStore</parameter>
</messageStore>

API:

<api xmlns="http://ws.apache.org/ns/synapse" name="API1" context="/details">
   <resource methods="GET" url-mapping="/test">
      <inSequence>
         <payloadFactory media-type="xml">
            <format>
               <p:select_with_key_CHASSIS_operation xmlns:p="https://car.data.wso2.com">
                  <xs:CHASSIS_ID xmlns:xs="https://car.data.wso2.com">1009</xs:CHASSIS_ID>
               </p:select_with_key_CHASSIS_operation>
            </format>
            <args/>
         </payloadFactory>
         <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" type="STRING"/>
          <property name="OUT_ONLY" value="true" scope="default" type="STRING"></property>
         <log level="full"/>
         <store messageStore="RabbitMS"/>
      </inSequence>
   </resource>
</api>

Message-Processor:

<messageProcessor name="Forwarder" class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor" targetEndpoint="sampleEndPoint" messageStore="RabbitMS" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="interval">1000</parameter>
   <parameter name="client.retry.interval">1000</parameter>
   <parameter name="max.delivery.attempts">4</parameter>
   <parameter name="is.active">true</parameter>
   <parameter name="max.delivery.drop">Disabled</parameter>
   <parameter name="member.count">1</parameter>
</messageProcessor>

End-point:

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="sampleEndPoint">
      </address>
</endpoint>


But when I invoke the API with the below curl command I could not see any messages stored in the message-store/queue or any logs in the console of ESB. 

curl command:
curl -X GET -H "Content-Type:application/json" 'http://192.168.8.100:8280/details'

Could you please suggest whether what I have done is correct or correct me if I have done something wrong.


Thanks.
Piriya

--
Regards,
Piriya Sivalingam
Software Engineer - Support Team
WSO2
Mobile : <a href="tel:+94%2077%20846%202039" value="+94778462039" target="_blank">+94 77 8462039

http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Godwin Amila Shrimal
Associate Technical Lead
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94772264165

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue in implementing Guaranteed Delivery EIP using RabbitMQ

Piriya Sivalingam
Hi,

Thank you for the response. I have tested the endpoint using the SOAPUI and it works fine. I will try the step 1 and let you know. 

Thanks,
Piriya.

On Fri, Dec 29, 2017 at 7:55 AM, Godwin Shrimal <[hidden email]> wrote:
Hi Piriya,

I don't see any issue with what you have done here. You can't see messages in the store, may be due to message processor consume that message and trying to send to the endpoint. You can do following things to troubleshoot this issue.

1. Remove messageprocessor temporarily and execute the curl command, then the message should be there in the store. If the message is still not there, then there should be something wrong with message queue configurations. 

2. If you can see the message in store in step #1, there can be something wrong with the endpoint you provided. You can enable wire log and troubleshoot that.

Thanks
Godwin


On Thu, Dec 28, 2017 at 10:47 PM, Piriya Sivalingam <[hidden email]> wrote:
Hi,

I am trying to implement guaranteed delivery EIP using WSO2ESB and WSO2DSS. My endpoint for this scenario is a dataservice in WSO2DSS. In this scenario, I am using RabbitMQ as the message broker. 

I followed the below steps to implement the guaranteed delivery scenario.
  • I installed RabbitMQ and Erlang OTP.
  • Then I added RabbitMQ message store according to the instructions in this [1] document.
  • I created an API with store mediator to stores messages using the above message store.
  • Then I created a Message-processor that consumes messages from the message-store and sends it to an endpoint.
Below are the configurations of the Message-Store, API and Message-Processor.

Message-Store:

<messageStore name="RabbitMS" class="org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="store.rabbitmq.host.name">localhost</parameter>
   <parameter name="store.rabbitmq.host.port">5672</parameter>
   <parameter name="store.rabbitmq.queue.name">RabbitMS_Queue</parameter>
   <parameter name="store.producer.guaranteed.delivery.enable">true</parameter>
   <parameter name="store.failover.message.store.name">InMemoryStore</parameter>
</messageStore>

API:

<api xmlns="http://ws.apache.org/ns/synapse" name="API1" context="/details">
   <resource methods="GET" url-mapping="/test">
      <inSequence>
         <payloadFactory media-type="xml">
            <format>
               <p:select_with_key_CHASSIS_operation xmlns:p="https://car.data.wso2.com">
                  <xs:CHASSIS_ID xmlns:xs="https://car.data.wso2.com">1009</xs:CHASSIS_ID>
               </p:select_with_key_CHASSIS_operation>
            </format>
            <args/>
         </payloadFactory>
         <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" type="STRING"/>
          <property name="OUT_ONLY" value="true" scope="default" type="STRING"></property>
         <log level="full"/>
         <store messageStore="RabbitMS"/>
      </inSequence>
   </resource>
</api>

Message-Processor:

<messageProcessor name="Forwarder" class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor" targetEndpoint="sampleEndPoint" messageStore="RabbitMS" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="interval">1000</parameter>
   <parameter name="client.retry.interval">1000</parameter>
   <parameter name="max.delivery.attempts">4</parameter>
   <parameter name="is.active">true</parameter>
   <parameter name="max.delivery.drop">Disabled</parameter>
   <parameter name="member.count">1</parameter>
</messageProcessor>

End-point:

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="sampleEndPoint">
      </address>
</endpoint>


But when I invoke the API with the below curl command I could not see any messages stored in the message-store/queue or any logs in the console of ESB. 

curl command:
curl -X GET -H "Content-Type:application/json" 'http://192.168.8.100:8280/details'

Could you please suggest whether what I have done is correct or correct me if I have done something wrong.


Thanks.
Piriya

--
Regards,
Piriya Sivalingam
Software Engineer - Support Team
WSO2
Mobile : <a href="tel:+94%2077%20846%202039" value="+94778462039" target="_blank">+94 77 8462039

http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Godwin Amila Shrimal
Associate Technical Lead
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94772264165



--
Regards,
Piriya Sivalingam
Software Engineer - Support Team
WSO2
Mobile : +94 77 8462039

http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue in implementing Guaranteed Delivery EIP using RabbitMQ

Eranda Rajapakshe
Hi Piriya,

It seems like the url you are trying to invoke is not correct, it should include the url-mapping part as well.

cURL command like below should work, 

curl -X GET -H "Content-Type:application/json" 'http://192.168.8.100:8280/details/test'

Thanks,

On Mon, Jan 1, 2018 at 4:30 PM, Piriya Sivalingam <[hidden email]> wrote:
Hi,

Thank you for the response. I have tested the endpoint using the SOAPUI and it works fine. I will try the step 1 and let you know. 

Thanks,
Piriya.

On Fri, Dec 29, 2017 at 7:55 AM, Godwin Shrimal <[hidden email]> wrote:
Hi Piriya,

I don't see any issue with what you have done here. You can't see messages in the store, may be due to message processor consume that message and trying to send to the endpoint. You can do following things to troubleshoot this issue.

1. Remove messageprocessor temporarily and execute the curl command, then the message should be there in the store. If the message is still not there, then there should be something wrong with message queue configurations. 

2. If you can see the message in store in step #1, there can be something wrong with the endpoint you provided. You can enable wire log and troubleshoot that.

Thanks
Godwin


On Thu, Dec 28, 2017 at 10:47 PM, Piriya Sivalingam <[hidden email]> wrote:
Hi,

I am trying to implement guaranteed delivery EIP using WSO2ESB and WSO2DSS. My endpoint for this scenario is a dataservice in WSO2DSS. In this scenario, I am using RabbitMQ as the message broker. 

I followed the below steps to implement the guaranteed delivery scenario.
  • I installed RabbitMQ and Erlang OTP.
  • Then I added RabbitMQ message store according to the instructions in this [1] document.
  • I created an API with store mediator to stores messages using the above message store.
  • Then I created a Message-processor that consumes messages from the message-store and sends it to an endpoint.
Below are the configurations of the Message-Store, API and Message-Processor.

Message-Store:

<messageStore name="RabbitMS" class="org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="store.rabbitmq.host.name">localhost</parameter>
   <parameter name="store.rabbitmq.host.port">5672</parameter>
   <parameter name="store.rabbitmq.queue.name">RabbitMS_Queue</parameter>
   <parameter name="store.producer.guaranteed.delivery.enable">true</parameter>
   <parameter name="store.failover.message.store.name">InMemoryStore</parameter>
</messageStore>

API:

<api xmlns="http://ws.apache.org/ns/synapse" name="API1" context="/details">
   <resource methods="GET" url-mapping="/test">
      <inSequence>
         <payloadFactory media-type="xml">
            <format>
               <p:select_with_key_CHASSIS_operation xmlns:p="https://car.data.wso2.com">
                  <xs:CHASSIS_ID xmlns:xs="https://car.data.wso2.com">1009</xs:CHASSIS_ID>
               </p:select_with_key_CHASSIS_operation>
            </format>
            <args/>
         </payloadFactory>
         <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" type="STRING"/>
          <property name="OUT_ONLY" value="true" scope="default" type="STRING"></property>
         <log level="full"/>
         <store messageStore="RabbitMS"/>
      </inSequence>
   </resource>
</api>

Message-Processor:

<messageProcessor name="Forwarder" class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor" targetEndpoint="sampleEndPoint" messageStore="RabbitMS" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="interval">1000</parameter>
   <parameter name="client.retry.interval">1000</parameter>
   <parameter name="max.delivery.attempts">4</parameter>
   <parameter name="is.active">true</parameter>
   <parameter name="max.delivery.drop">Disabled</parameter>
   <parameter name="member.count">1</parameter>
</messageProcessor>

End-point:

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="sampleEndPoint">
      </address>
</endpoint>


But when I invoke the API with the below curl command I could not see any messages stored in the message-store/queue or any logs in the console of ESB. 

curl command:
curl -X GET -H "Content-Type:application/json" 'http://192.168.8.100:8280/details'

Could you please suggest whether what I have done is correct or correct me if I have done something wrong.


Thanks.
Piriya

--
Regards,
Piriya Sivalingam
Software Engineer - Support Team
WSO2
Mobile : <a href="tel:+94%2077%20846%202039" value="+94778462039" target="_blank">+94 77 8462039

http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Godwin Amila Shrimal
Associate Technical Lead
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94772264165



--
Regards,
Piriya Sivalingam
Software Engineer - Support Team
WSO2
Mobile : <a href="tel:+94%2077%20846%202039" value="+94778462039" target="_blank">+94 77 8462039

http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Eranda Rajapakshe
Software Engineer
WSO2 Inc.
Mobile : <a href="tel:%2B94784822608" value="+94784822608" target="_blank">+94784822608

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev