Bug 1001612

Summary: Adding functionality to change "connector" to "discovery-group-name" for the existing JMS connection factories
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Masafumi Miura <mmiura>
Component: JMSAssignee: Jeff Mesnil <jmesnil>
Status: CLOSED CURRENTRELEASE QA Contact: Miroslav Novak <mnovak>
Severity: unspecified Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.1.0CC: brian.stansberry
Target Milestone: ER3   
Target Release: EAP 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-15 16:13:18 UTC Type: Enhancement
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Masafumi Miura 2013-08-27 11:49:45 UTC
### Description of problem:

As per AS7-5107, cluster-connections, bridges and JMS connection factories defines either connectors or discovery-group but not both. 

Therefore, since EAP 6.1.0 we can not write "discovery-group-name" attribute to JMS connection factories when the connection factories is already defined with "connector" attribute:

~~~
  [standalone@localhost:9999 /] /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:write-attribute(name=discovery-group-name,value=dg-group1)
  {
      "outcome" => "failed",
      "failure-description" => "JBAS011630: Alternative attribute of (discovery-group-name) is already defined.",
      "rolled-back" => true
  }
~~~

Also we can not undefine predefined "connector" attribute of the connection factories:

~~~
  [standalone@localhost:9999 /] /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:undefine-attribute(name=connector)
  {
      "outcome" => "failed",
      "failure-description" => "JBAS014749: Operation handler failed: JBAS011664: Runtime handling for connector is not implemented",
      "rolled-back" => true
  }
~~~

I also tried batch CLI but it did not help. We can not undefine the predefined "connector" attribute regardless of using batch CLI or not:

~~~
  [standalone@localhost:9999 /] batch
  [standalone@localhost:9999 / #] /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:undefine-attribute(name=connector)
  #1 /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:undefine-attribute(name=connector)
  [standalone@localhost:9999 / #] /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:write-attribute(name=discovery-group-name,value=dg-group1)
  #2 /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:write-attribute(name=discovery-group-name,value=dg-group1)
  [standalone@localhost:9999 / #] list-batch
  #1 /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:undefine-attribute(name=connector)
  #2 /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:write-attribute(name=discovery-group-name,value=dg-group1)
  [standalone@localhost:9999 / #] run-batch
  {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => "JBAS011630: Alternative attribute of (connector) is already defined."}}
~~~

To change change "connector" to "discovery-group-name", we need to remove the existing connection factories then recreate a new connection factories. For example:

~~~
  /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:remove
  :reload
  /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory/:add(entries=["java:jboss/exported/jms/RemoteConnectionFactory"],discovery-group-name=dg-group1)
~~~

The customer asks us for adding functionality to change "connector" to "discovery-group-name" (and vice-versa) for the existing JMS connection factories without removing the connection factories. Because doing remove and create connection factories lose all predefined attribute for the connection factories.


### Version-Release number of selected component (if applicable):

EAP 6.1.0 / "full" or "full-ha" profile


### How reproducible:

Everytime.


### Steps to Reproduce:

1. Start out-of-the-box EAP 6.1.0 with standalone-full-ha.xml
2. Try out the above CLI scripts


### Actual results:

You can not write "discovery-group-name" attribute to the connection factories and also you can not undefine predefined "connector" attribute of the connection factories.


### Expected results:

You can write "discovery-group-name" attribute to the connection factories and also you can undefine predefined "connector" attribute of the connection factories in order to change "connector" to "discovery-group-name".

Comment 2 JBoss JIRA Server 2013-09-13 14:28:01 UTC
Jeff Mesnil <jmesnil> made a comment on jira WFLY-2069

PR for master branch

Comment 4 JBoss JIRA Server 2013-10-04 08:36:20 UTC
Jeff Mesnil <jmesnil> made a comment on jira WFLY-2069

PR merged in master branch

Comment 6 Miroslav Novak 2013-10-07 08:01:52 UTC
BZ was verified in EAP 6.2.0.ER4 by following batch:

batch
/subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:undefine-attribute(name=connector)
/subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:write-attribute(name=discovery-group-name,value=dg-group1)
run-batch

In this way connector for connection factory can be undefined and set discovery-group. Or discovery-group undefined and changed set connector.

This must be done in a batch or commands will fail as it is reported in description.