[
https://issues.apache.org/jira/browse/NIFI-5360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16529449#comment-16529449
]
Kelsey Rider commented on NIFI-5360:
------------------------------------
Suggested by Mark Payne via the mailing list:
So it appears that when using RabbitMQ, it's attempting to access the RabbitMQ
classes in a call
from the ConsumeJMS processor, not from within the ConnectionFactory. I think
we may end up
needing to include a new property in ConsumeJMS / PublishJMS that optionally
allow you to specify
the libraries to use for those processors, as well. I.e., in addition to
needing the libraries in the
Connection Factory Controller Service, for some vendors we will need to also
provide the libraries
to the Processor.
Fortunately, it should be an easy enough change to make, if that's what is
necessary. We would basically
just need to create a Property Descriptor in the processor that is similar to
the one in the Controller Service:
public static final PropertyDescriptor CLIENT_LIB_DIR_PATH = new
PropertyDescriptor.Builder()
.name(CF_LIB)
.displayName("MQ Client Libraries path (i.e., /usr/jms/lib)")
.description("Path to the directory with additional resources
(i.e., JARs, configuration files etc.) to be added "
+ "to the classpath. Such resources typically represent
target MQ client libraries for the "
+ "ConnectionFactory implementation.")
.addValidator(StandardValidators.createListValidator(true, true,
StandardValidators.createURLorFileValidator()))
.required(true)
.dynamicallyModifiesClasspath(true)
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
.build();
And then return that in the processor's list of properties. The Processors
itself doesn't actually need to do anything with that property,
because the framework will detect the ".dynamicallyModifiesClasspath(true)"
part and handle it for us.
> Simple JMS pub-sub not working
> ------------------------------
>
> Key: NIFI-5360
> URL: https://issues.apache.org/jira/browse/NIFI-5360
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Affects Versions: 1.6.0
> Reporter: Kelsey Rider
> Priority: Major
> Labels: jms
>
> A simple JMS pub-sub flow using RabbitMQ does not work.
> # Install/setup RabbitMQ
> # Create a JMSConnectionFactoryProvider, and configure it to work with
> RabbitMQ (including the required JARs *amqp-client* and *rabbitmq-jms*)
> # Create a flow with *GenerateFlowFile -> PublishJMS* to publish something
> on a queue
> # Create a *ConsumeJMS* processor that attempts to recover what was just
> published
> Result: when the message is consumed, the ClassLoader does not have the JMS
> libraries.
> {{2018-06-28 15:47:27,161 ERROR [Timer-Driven Process Thread-9]
> o.apache.nifi.jms.processors.ConsumeJMS
> ConsumeJMS[id=01641047-1441-10a4-ce22-23d392689dd9]
> ConsumeJMS[id=01641047-1441-10a4-ce22-23d392689dd9] failed to process session
> due to org.springframework.jms.UncategorizedJmsException: Uncategorized
> exception occured during JMS processing; nested exception is
> com.rabbitmq.jms.util.RMQJMSException:
> com.rabbitmq.jms.client.message.RMQTextMessage; Processor Administratively
> Yielded for 1 sec: org.springframework.jms.UncategorizedJmsException:
> Uncategorized exception occured during JMS processing; nested exception is
> com.rabbitmq.jms.util.RMQJMSException:
> com.rabbitmq.jms.client.message.RMQTextMessage}}{{org.springframework.jms.UncategorizedJmsException:
> Uncategorized exception occured during JMS processing; nested exception is
> com.rabbitmq.jms.util.RMQJMSException:
> com.rabbitmq.jms.client.message.RMQTextMessage}}{{ at
> org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)}}{{
> at
> org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)}}{{
> at
> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:497)}}{{
> at
> org.apache.nifi.jms.processors.JMSConsumer.consume(JMSConsumer.java:85)}}{{
> at
> org.apache.nifi.jms.processors.ConsumeJMS.rendezvousWithJms(ConsumeJMS.java:181)}}{{
> at
> org.apache.nifi.jms.processors.ConsumeJMS.rendezvousWithJms(ConsumeJMS.java:59)}}{{
> at
> org.apache.nifi.jms.processors.AbstractJMSProcessor.onTrigger(AbstractJMSProcessor.java:157)}}{{
> at
> org.apache.nifi.jms.processors.ConsumeJMS.onTrigger(ConsumeJMS.java:59)}}{{
> at
> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)}}{{
> at
> org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1147)}}{{
> at
> org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:175)}}{{
> at
> org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)}}{{
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)}}{{
> at
> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)}}{{
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)}}{{
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)}}{{
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}{{
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}{{
> at java.lang.Thread.run(Thread.java:748)}}{{Caused by:
> com.rabbitmq.jms.util.RMQJMSException:
> com.rabbitmq.jms.client.message.RMQTextMessage}}{{ at
> com.rabbitmq.jms.client.RMQMessage.instantiateRmqMessage(RMQMessage.java:1070)}}{{
> at
> com.rabbitmq.jms.client.RMQMessage.fromMessage(RMQMessage.java:1030)}}{{
> at
> com.rabbitmq.jms.client.RMQMessage.convertJmsMessage(RMQMessage.java:871)}}{{
> at
> com.rabbitmq.jms.client.RMQMessage.convertMessage(RMQMessage.java:865)}}{{
> at
> com.rabbitmq.jms.client.RMQMessageConsumer.receive(RMQMessageConsumer.java:331)}}{{
> at
> com.rabbitmq.jms.client.RMQMessageConsumer.receive(RMQMessageConsumer.java:246)}}{{
> at
> org.apache.nifi.jms.processors.JMSConsumer$1.doInJms(JMSConsumer.java:95)}}{{
> at
> org.apache.nifi.jms.processors.JMSConsumer$1.doInJms(JMSConsumer.java:85)}}{{
> at
> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:494)}}{{
> ... 16 common frames omitted}}{{Caused by:
> java.lang.ClassNotFoundException:
> com.rabbitmq.jms.client.message.RMQTextMessage}}{{ at
> java.net.URLClassLoader.findClass(URLClassLoader.java:381)}}{{
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)}}{{ at
> java.lang.ClassLoader.loadClass(ClassLoader.java:357)}}{{ at
> java.lang.Class.forName0(Native Method)}}{{ at
> java.lang.Class.forName(Class.java:348)}}{{ at
> com.rabbitmq.jms.client.RMQMessage.instantiateRmqMessage(RMQMessage.java:1064)}}{{
> ... 24 common frames omitted}}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)