[ 
https://issues.apache.org/jira/browse/NIFI-2701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16009068#comment-16009068
 ] 

wayne Sang edited comment on NIFI-2701 at 5/13/17 2:55 AM:
-----------------------------------------------------------

Guys, I have coded up a JNDI connection factory provider to provide needed 
support. Solace does not have zero-argument connection factory constructor. 
However, most JMS brokers support JNDI. The code has worked well with Solace. 
The testcase is run using ActiveMQ's JNDI connection factory. The code is based 
on 1.1.2 release and is available at https://github.com/lsac/nifi-jms-jndi. 

The 2 generated NAR files can be dropped right into lib and BAU (business as 
usual) again.


was (Author: vmr):
Guys, I have coded up a JNDI connection factory provider to provide needed 
support. Solace does not have zero-argument connection factory constructor. 
However, most JMS brokers support JNDI. The code has worked well with Solace. 
The testcase is run using ActiveMQ's JNDI connection factory. The code is based 
on 1.1.2 release and is available at https://github.com/lsac/nifi-jms-jndi. 

> Can’t consume JMS Messages from remote broker
> ---------------------------------------------
>
>                 Key: NIFI-2701
>                 URL: https://issues.apache.org/jira/browse/NIFI-2701
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.0.0, 0.7.0
>         Environment: Windows 7
>            Reporter: Raymond
>            Assignee: Oleg Zhurakousky
>
> I’m using the ConsumeJMS together with JMSConnectionFactoryProvider service 
> to consume message from a SonicMQ broker. If I’m using a NiFi instance and 
> the broker on the same machine this works. I can consume the messages from 
> the queue on the broker (using the broker url: tcp://localhost:2506). 
> If the broker is on another machine I get the following error:
> 08:55:48 CEST
> WARNING
> d6d8ec67-0156-1000-006c-054ada0ce528
> ConsumeJMS - JMSConsumer[destination:q.testconnector.inbox; pub-sub:false;] 
> Processor Administratively Yielded for 1 sec due to processing failure
> 08:55:51 CEST
> ERROR
> d6d8ec67-0156-1000-006c-054ada0ce528
> ConsumeJMS - JMSConsumer[destination:q.testconnector.inbox; pub-sub:false;] 
> ConsumeJMS - JMSConsumer[destination:q.testconnector.inbox; pub-sub:false;] 
> failed to process due to org.springframework.jms.UncategorizedJmsException: 
> Uncategorized exception occured during JMS processing; nested exception is 
> javax.jms.JMSException: java.net.ConnectException: Connection refused: 
> connect: ServerA; rolling back session: 
> org.springframework.jms.UncategorizedJmsException: Uncategorized exception 
> occured during JMS processing; nested exception is javax.jms.JMSException: 
> java.net.ConnectException: Connection refused: connect: ServerA
> Server A is the machine where the NiFi instance is running. So the connection 
> is not refused by the machine where the broker is running. The broker is 
> running correctly and I can connect from the same machine with other JMS 
> Clients with same credentials. This problem occurred with a NiFi 0.6.1 and 
> 1.0B instance.
> Log:
> org.springframework.jms.UncategorizedJmsException: Uncategorized exception 
> occured during JMS processing; nested exception is javax.jms.JMSException: 
> java.net.ConnectException: Connection refused: connect: SERVERA
>       at 
> org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)
>  ~[na:na]
>       at 
> org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)
>  ~[na:na]
>       at 
> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:497) 
> ~[na:na]
>       at 
> org.springframework.jms.core.JmsTemplate.receiveSelected(JmsTemplate.java:764)
>  ~[na:na]
>       at 
> org.springframework.jms.core.JmsTemplate.receive(JmsTemplate.java:738) 
> ~[na:na]
>       at 
> org.springframework.jms.core.JmsTemplate.receive(JmsTemplate.java:727) 
> ~[na:na]
>       at 
> org.apache.nifi.jms.processors.JMSConsumer.consume(JMSConsumer.java:65) 
> ~[na:na]
>       at 
> org.apache.nifi.jms.processors.ConsumeJMS.rendezvousWithJms(ConsumeJMS.java:79)
>  ~[na:na]
>       at 
> org.apache.nifi.jms.processors.AbstractJMSProcessor.onTrigger(AbstractJMSProcessor.java:136)
>  ~[na:na]
>       at 
> org.apache.nifi.jms.processors.ConsumeJMS.onTrigger(ConsumeJMS.java:50) 
> ~[na:na]
>       at 
> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
>  ~[nifi-api-1.0.0-BETA.jar:1.0.0-BETA]
>       at 
> org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1060)
>  ~[nifi-framework-core-1.0.0-BETA.jar:1.0.0-BETA]
>       at 
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:136)
>  [nifi-framework-core-1.0.0-BETA.jar:1.0.0-BETA]
>       at 
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
>  [nifi-framework-core-1.0.0-BETA.jar:1.0.0-BETA]
>       at 
> org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:127)
>  [nifi-framework-core-1.0.0-BETA.jar:1.0.0-BETA]
>       at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 
> [na:1.8.0_102]
>       at java.util.concurrent.FutureTask.runAndReset(Unknown Source) 
> [na:1.8.0_102]
>       at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown
>  Source) [na:1.8.0_102]
>       at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
>  Source) [na:1.8.0_102]
>       at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
> [na:1.8.0_102]
>       at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
> [na:1.8.0_102]
>       at java.lang.Thread.run(Unknown Source) [na:1.8.0_102]
> Caused by: javax.jms.JMSException: java.net.ConnectException: Connection 
> refused: connect: SERVERA
>       at 
> progress.message.jimpl.JMSExceptionUtil.createJMSException(JMSExceptionUtil.java:42)
>  ~[na:na]
>       at progress.message.jimpl.Connection.<init>(Connection.java:964) 
> ~[na:na]
>       at 
> progress.message.jclient.ConnectionFactory.createConnection(ConnectionFactory.java:2305)
>  ~[na:na]
>       at 
> org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.doCreateConnection(UserCredentialsConnectionFactoryAdapter.java:178)
>  ~[na:na]
>       at 
> org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.createConnection(UserCredentialsConnectionFactoryAdapter.java:152)
>  ~[na:na]
>       at 
> org.springframework.jms.connection.SingleConnectionFactory.doCreateConnection(SingleConnectionFactory.java:365)
>  ~[na:na]
>       at 
> org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:305)
>  ~[na:na]
>       at 
> org.springframework.jms.connection.SingleConnectionFactory.getConnection(SingleConnectionFactory.java:283)
>  ~[na:na]
>       at 
> org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:224)
>  ~[na:na]
>       at 
> org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)
>  ~[na:na]
>       at 
> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:484) 
> ~[na:na]
>       ... 19 common frames omitted
> Caused by: progress.message.client.ENetworkFailure: 
> java.net.ConnectException: Connection refused: connect: SERVERA
>       at 
> progress.message.zclient.Connection.connectWithRecoveryOpt(Connection.java:1178)
>  ~[na:na]
>       at 
> progress.message.zclient.ReconnectHelper.connectAndChaseSingleFailoverRedirect(ReconnectHelper.java:534)
>  ~[na:na]
>       at progress.message.zclient.Connection.connect(Connection.java:1600) 
> ~[na:na]
>       at progress.message.jimpl.Connection.<init>(Connection.java:845) 
> ~[na:na]
>       ... 28 common frames omitted
> Caused by: java.net.ConnectException: Connection refused: connect
>       at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method) 
> ~[na:1.8.0_102]
>       at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) 
> ~[na:1.8.0_102]
>       at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) 
> ~[na:1.8.0_102]
>       at java.net.AbstractPlainSocketImpl.connect(Unknown Source) 
> ~[na:1.8.0_102]
>       at java.net.PlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_102]
>       at java.net.SocksSocketImpl.connect(Unknown Source) ~[na:1.8.0_102]
>       at java.net.Socket.connect(Unknown Source) ~[na:1.8.0_102]
>       at java.net.Socket.connect(Unknown Source) ~[na:1.8.0_102]
>       at java.net.Socket.<init>(Unknown Source) ~[na:1.8.0_102]
>       at java.net.Socket.<init>(Unknown Source) ~[na:1.8.0_102]
>       at 
> progress.message.net.tcp.ProgressTcpSocket.openSocket(ProgressTcpSocket.java:87)
>  ~[na:na]
>       at 
> progress.message.net.tcp.AbstractTcpSocket.<init>(AbstractTcpSocket.java:87) 
> ~[na:na]
>       at 
> progress.message.net.tcp.ProgressTcpSocket.<init>(ProgressTcpSocket.java:62) 
> ~[na:na]
>       at 
> progress.message.net.tcp.ProgressTcpSocketFactory.createProgressSocket(ProgressTcpSocketFactory.java:55)
>  ~[na:na]
>       at 
> progress.message.net.ProgressSocketFactory.createProgressSocket(ProgressSocketFactory.java:180)
>  ~[na:na]
>       at progress.message.zclient.Connection.openSocket(Connection.java:3570) 
> ~[na:na]
>       at 
> progress.message.zclient.Connection.connectWithRecoveryOpt(Connection.java:850)
>  ~[na:na]
>       ... 31 common frames omitted



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to