product-ei icon indicating copy to clipboard operation
product-ei copied to clipboard

MessagePropertyHyphens Replace is not working with JMS_Inbound

Open GDLMadushanka opened this issue 3 years ago • 0 comments

Description: MessagePropertyHyphens property is supposed to remove hyphens in the incoming message to the inbound endpoint. But its not working as expected.

Suggested Labels: Bug

Affected Product Version: EI-6.6.0

Steps to reproduce: Configure and start the WSO2 MB profile and EI following the documentation Add the following artifacts API

<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse" name="front" context="/front">
   <resource methods="POST">
      <inSequence>
         <log/>
         <property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
         <property name="TEST-JMS-HEADER" value="ThisisthetestHeader" scope="transport"/>
         <log level="custom">
            <property name="JMSPublisherProxy Set JMSHeader TEST_JMS_HEADER "
                      expression="$trp:TEST-JMS-HEADER"/>
         </log>
         <log level="custom">
            <property name="JMSPublisherProxy" value="Publishing the JMS message .... "/>
         </log>
         <call>
            <endpoint>
               <address uri="jms:/SMSStore?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&amp;java.naming.provider.url=conf/jndi.properties&amp;transport.jms.DestinationType=queue&amp;transport.jms.MessagePropertyHyphens=replace"/>
            </endpoint>
         </call>
         <log level="custom">
            <property name="JMSPublisherProxy" value="JMS message published"/>
         </log>
         <respond/>
      </inSequence>
   </resource>
</api>

Inbound

<?xml version="1.0" encoding="UTF-8"?>
<inboundEndpoint xmlns="http://ws.apache.org/ns/synapse"
                 name="myJMSInbound"
                 sequence="mylog"
                 onError="fault"
                 protocol="jms"
                 suspend="false">
   <parameters>
      <parameter name="interval">1000</parameter>
      <parameter name="sequential">true</parameter>
      <parameter name="coordination">true</parameter>
      <parameter name="java.naming.factory.initial">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
      <parameter name="java.naming.provider.url">conf/jndi.properties</parameter>
      <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
      <parameter name="transport.jms.ConnectionFactoryType">queue</parameter>
      <parameter name="transport.jms.Destination">SMSStore</parameter>
      <parameter name="transport.jms.SessionAcknowledgement">AUTO_ACKNOWLEDGE</parameter>
      <parameter name="transport.jms.CacheLevel">3</parameter>
      <parameter name="transport.jms.ReceiveTimeout">-1</parameter>
      <parameter name="transport.jms.ContentType">application/json</parameter>
      <parameter name="transport.jms.MessagePropertyHyphens">replace</parameter>
      <parameter name="transport.jms.ResetConnectionOnPollingSuspension">false</parameter>
   </parameters>
</inboundEndpoint>

Sequence

<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="mylog">
   <log>
      <property name="Inbound Endpoint get JMSHeader X-APIM-Application" expression="$trp:X-APIM-Application"/>
      <property name="Inbound Endpoint get JMSHeader TEST-JMS-HEADER "
                expression="$trp:TEST-JMS-HEADER"/>
   </log>
   <property name="SET_ROLLBACK_ONLY" value="true" scope="axis2"/>
</sequence>

GDLMadushanka avatar Apr 07 '21 09:04 GDLMadushanka