Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EI remove the messages of RabbitMQ even if SET_ROLLBACK_ONLY is used #2210

Closed
robertonav20 opened this issue May 29, 2018 · 1 comment
Closed
Labels
IceBox Older issues that are not being actively worked on but may be revisited in the future.

Comments

@robertonav20
Copy link

robertonav20 commented May 29, 2018

Description:
When the variable SET_ROLLBACK_ONLY exist the message is deleted equally from the server.
In the fault sequence i've set the property SET_ROLLBACK_ONLY for don't remove the message from the RabbitMQ server, but the message is removed.

<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="Rabbit_ReadMessage"
       transports="rabbitmq"
       startOnLoad="true">
   <description/>
   <target>
      <inSequence>
             ---- Consume Message ----
      </inSequence>
      <faultSequence>
         <property name="SET_ROLLBACK_ONLY" value="true" scope="axis2"/>
         <log level="full" category="ERROR">
            <property name="message" value="Message could not be delivered"/>
            <property name="error_code" expression="$ctx:ERROR_CODE"/>
            <property name="error_message" expression="$ctx:ERROR_MESSAGE"/>
            <property name="error_detail" expression="$ctx:ERROR_DETAIL"/>
         </log>
      </faultSequence>
   </target>
   <parameter name="rabbitmq.queue.routing.key">Log</parameter>
   <parameter name="rabbitmq.exchange.name">amq.direct</parameter>
   <parameter name="rabbitmq.queue.name">LogQueue</parameter>
   <parameter name="rabbitmq.connection.factory">AMQPConnectionFactory</parameter>
   <parameter name="rabbitmq.message.content.type">application/xml</parameter>
</proxy>

With the variable SET_ROLLBACK_ONLY setted in the fault sequence, I expect that the message will not be removed, but it doesn't happen

Suggested Labels:
I suggest adding the tested following lines of code to the class RabbitMQMessageReceiver.java

 Object o = msgContext.getProperty(BaseConstants.SET_ROLLBACK_ONLY);
            if (o != null) {
                if ((o instanceof Boolean && ((Boolean) o)) ||
                        (o instanceof String && Boolean.valueOf((String) o))) {
                            return false;
                }
            }

Suggested Assignees:

Affected Product Version:
WSO2 EI 6.3.0-M9

OS, DB, other environment details and versions:
Windows, JDK 8

Steps to reproduce:

Related Issues:
https://github.com/wso2/wso2-axis2-transports/issues/166
wso2-axis2-transports

@isudana
Copy link
Contributor

isudana commented Jun 11, 2018

Fixes done in wso2/wso2-axis2-transports. Updating to 2.0.0-wso2v23 or later will resolve this.

@anupama-pathirage anupama-pathirage added the IceBox Older issues that are not being actively worked on but may be revisited in the future. label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IceBox Older issues that are not being actively worked on but may be revisited in the future.
Projects
None yet
Development

No branches or pull requests

3 participants