Specifying order of new JGroups Protocol

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Specifying order of new JGroups Protocol

Michael Irwin
I'm adding a JGroup stack protocol using this command:

/subsystem=jgroups/stack=tcp/protocol=JDBC_PING:add()

But, the new protocol is added to the end of the list of protocols.  And, since protocol order matters, how do I add the protocol to the front of the list?  And, I'd prefer to do it without tweaking the XML directly.  Any pointers?

--
Michael Irwin

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: Specifying order of new JGroups Protocol

Richard Achmatowicz

Hi Michael

There is no operation for inserting a protocol layer at a specific position in the stack.
You will have to remove the original stack definition and recreate it with a series of commands.
This can be placed into a CLI batch and executed as a script if you need to do it often.
Here is an example:

contents of the CLI script (the following commands in a text file called, say, setstack.cli):
--------------------------------------------------------------------------------------
connect
batch
/subsystem=jgroups/stack=tcp:remove()

/subsystem=jgroups/stack=tcp:add()
/subsystem=jgroups/stack=tcp/transport=TCP:add(socket-binding="jgroups-tcp")
/subsystem=jgroups/stack=tcp/protocol=MPING:add(socket-binding="jgroups-mping")
/subsystem=jgroups/stack=tcp/protocol=MERGE3:add()
/subsystem=jgroups/stack=tcp/protocol=FDSOCK:add(socket-binding="jgroups-tcp-fd")
/subsystem=jgroups/stack=tcp/protocol=FD:add()
/subsystem=jgroups/stack=tcp/protocol=VERIFY_SUSPECT:add()
/subsystem=jgroups/stack=tcp/protocol=pbcast.NAKACK2:add()
/subsystem=jgroups/stack=tcp/protocol=UNICAST3:add()
/subsystem=jgroups/stack=tcp/protocol=pbcast.STABLE:add()
/subsystem=jgroups/stack=tcp/protocol=pbcast.GMS:add()
/subsystem=jgroups/stack=tcp/protocol=MFC:add()
/subsystem=jgroups/stack=tcp/protocol=FRAG2:add()
run-batch
--------------------------------------------------------------------------------------

execute the CLI script:
./jboss-cli.sh --file=setstack.cli

Richard
On 29/07/16 12:59 PM, Michael Irwin wrote:
I'm adding a JGroup stack protocol using this command:

/subsystem=jgroups/stack=tcp/protocol=JDBC_PING:add()

But, the new protocol is added to the end of the list of protocols.  And, since protocol order matters, how do I add the protocol to the front of the list?  And, I'd prefer to do it without tweaking the XML directly.  Any pointers?

--
Michael Irwin


_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev


_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: Specifying order of new JGroups Protocol

Brian Stansberry
There was an “add-index” param that was added in 10[1] and perhaps only became functional in the just released 10.1.0.CR1 due to [2].


On Jul 29, 2016, at 4:30 PM, Richard Achmatowicz <[hidden email]> wrote:

Hi Michael

There is no operation for inserting a protocol layer at a specific position in the stack.
You will have to remove the original stack definition and recreate it with a series of commands.
This can be placed into a CLI batch and executed as a script if you need to do it often.
Here is an example:

contents of the CLI script (the following commands in a text file called, say, setstack.cli):
--------------------------------------------------------------------------------------
connect
batch
/subsystem=jgroups/stack=tcp:remove()

/subsystem=jgroups/stack=tcp:add()
/subsystem=jgroups/stack=tcp/transport=TCP:add(socket-binding="jgroups-tcp")
/subsystem=jgroups/stack=tcp/protocol=MPING:add(socket-binding="jgroups-mping")
/subsystem=jgroups/stack=tcp/protocol=MERGE3:add()
/subsystem=jgroups/stack=tcp/protocol=FDSOCK:add(socket-binding="jgroups-tcp-fd")
/subsystem=jgroups/stack=tcp/protocol=FD:add()
/subsystem=jgroups/stack=tcp/protocol=VERIFY_SUSPECT:add()
/subsystem=jgroups/stack=tcp/protocol=pbcast.NAKACK2:add()
/subsystem=jgroups/stack=tcp/protocol=UNICAST3:add()
/subsystem=jgroups/stack=tcp/protocol=pbcast.STABLE:add()
/subsystem=jgroups/stack=tcp/protocol=pbcast.GMS:add()
/subsystem=jgroups/stack=tcp/protocol=MFC:add()
/subsystem=jgroups/stack=tcp/protocol=FRAG2:add()
run-batch
--------------------------------------------------------------------------------------

execute the CLI script:
./jboss-cli.sh --file=setstack.cli

Richard
On 29/07/16 12:59 PM, Michael Irwin wrote:
I'm adding a JGroup stack protocol using this command:

/subsystem=jgroups/stack=tcp/protocol=JDBC_PING:add()

But, the new protocol is added to the end of the list of protocols.  And, since protocol order matters, how do I add the protocol to the front of the list?  And, I'd prefer to do it without tweaking the XML directly.  Any pointers?

--
Michael Irwin


_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev

-- 
Brian Stansberry
Manager, Senior Principal Software Engineer
JBoss by Red Hat




_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev