Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-7600

Defining JMS attribute types breaks due to invalid characters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 1.11.4
    • None
    • Extensions
    • Patch

    Description

      JMSPublisher causes Exception when setting attributes in the JMS message due to invalid characters.  When defining types to be used when sending JMS attributes (e.g. JMS_IBM_Encoding.type=integer) , the JMSPublishercorrectly sets the type but also adds the '.type' attribute into the message, causing an Exception as JMS doesnt support a dot character in attribute names. 

      NIFI-6957 was suppose to fix this however the change in JMSPublish was removed.

      There is an option to 'allowIllegalChars' in PublishJMS however '.type' attributes are passed along regardless of this setting.

       

      The JMSPublisher should ignore message attributes ending with '.type' when there is a matching attribute without the '.type' suffix

       

      example exception.

       

      com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0049: The property name 'JMS_IBM_Encoding.type' is not a valid Java(tm) identifier.

      The supplied property name does not conform to the allowed format described in the JMS specification.

      Check the characters used in the property name and modify as necessary.

                      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

                      at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                      at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)

                      at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)

                      at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:226)

                      at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:126)

                      at com.ibm.msg.client.jms.internal.JmsMessageImpl.checkPropName(JmsMessageImpl.java:2595)

                      at com.ibm.msg.client.jms.internal.JmsMessageImpl.setStringProperty(JmsMessageImpl.java:1997)

                      at com.ibm.jms.JMSMessage.setStringProperty(JMSMessage.java:1516)

                      at jdk.internal.reflect.GeneratedMethodAccessor198.invoke(Unknown Source)

                      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                      at java.base/java.lang.reflect.Method.invoke(Method.java:566)

                      at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:254)

                      at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler$ProxiedReturnObjectInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:240)

                      at com.sun.proxy.$Proxy145.setStringProperty(Unknown Source)

                      at org.apache.nifi.jms.processors.JMSPublisher$JmsPropertySetterEnum.lambda$static$7(JMSPublisher.java:196)

                      at org.apache.nifi.jms.processors.JMSPublisher$JmsPropertySetterEnum.setProperty(JMSPublisher.java:205)

                      at org.apache.nifi.jms.processors.JMSPublisher.setMessageHeaderAndProperties(JMSPublisher.java:123)

                      at org.apache.nifi.jms.processors.JMSPublisher$1.createMessage(JMSPublisher.java:59)

                      at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:593)

                      at org.springframework.jms.core.JmsTemplate$4.doInJms(JmsTemplate.java:574)

                      at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:484)

                      at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:570)

                      at org.apache.nifi.jms.processors.JMSPublisher.publish(JMSPublisher.java:54)

                      at org.apache.nifi.jms.processors.PublishJMS.rendezvousWithJms(PublishJMS.java:214)

                      at org.apache.nifi.jms.processors.PublishJMS.rendezvousWithJms(PublishJMS.java:68)

                      at org.apache.nifi.jms.processors.AbstractJMSProcessor.onTrigger(AbstractJMSProcessor.java:192)

                      at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)

                      at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1174)

                      at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:213)

                      at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)

                      at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)

                      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)

                      at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)

                      at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)

                      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

                      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

                      at java.base/java.lang.Thread.run(Thread.java:834)

      Attachments

        Issue Links

          Activity

            People

              dazhit Darren Hitchman
              dazhit Darren Hitchman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 4h
                  4h
                  Remaining:
                  Time Spent - 1h 10m Remaining Estimate - 2h 50m
                  2h 50m
                  Logged:
                  Time Spent - 1h 10m Remaining Estimate - 2h 50m
                  1h 10m