Github user ijokarumawak commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1863#discussion_r124441093
  
    --- Diff: 
nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/ConsumeJMS.java
 ---
    @@ -86,6 +86,31 @@
                 .defaultValue(CLIENT_ACK.getValue())
                 .build();
     
    +    static final PropertyDescriptor DURABLE_SUBSCRIBER = new 
PropertyDescriptor.Builder()
    +                                                             
.name("Durable subscription")
    +                                                             
.description("If destination is Topic if present then make it the consumer 
durable. " +
    +                                                                          
"@see 
https://docs.oracle.com/javaee/7/api/javax/jms/Session.html#createDurableConsumer-javax.jms.Topic-java.lang.String-";)
    +                                                             
.required(false)
    +                                                             
.expressionLanguageSupported(true)
    +                                                             
.defaultValue("true")
    --- End diff --
    
    I'm testing these new properties with Active MQ. With durable subscription 
enabled, I got following error:
    
    ```
    Caused by: javax.jms.JMSException: You cannot create a durable subscriber 
without specifying a unique clientID on a Connection
            at 
org.apache.activemq.ActiveMQConnection.checkClientIDWasManuallySpecified(ActiveMQConnection.java:1288)
            at 
org.apache.activemq.ActiveMQSession.createDurableSubscriber(ActiveMQSession.java:1467)
            at 
org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.getCachedConsumer(CachingConnectionFactory.java:442)
            at 
org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.invoke(CachingConnectionFactory.java:356)
            at com.sun.proxy.$Proxy84.createDurableConsumer(Unknown Source)
            at 
org.apache.nifi.jms.processors.JMSConsumer$1.doInJms(JMSConsumer.java:87)
            at 
org.apache.nifi.jms.processors.JMSConsumer$1.doInJms(JMSConsumer.java:65)
            at 
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:494)
            ... 16 common frames omitted
    ```
    
    I think we need to set unique client id at each processor. Probably at 
AbstractJMSProcessor.java
    
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/AbstractJMSProcessor.java#L198
    
    ```
    // Need to add something like this:
    this.cachingConnectionFactory.setClientId("some-unique-id");
    ```
    
    I'm wondering if client id can be the same value with subscription name... 
I will research on this a bit more, but do you have any idea?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to