[JBoss Messaging] - Re: 1.2.0.GA transparent node failover does not always work
by timfox
"bander" wrote : Following on from this thread: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=102491
|
| I'm currently experiencing multiple failover issues with the 1.2.0.GA release. I'm running two clustered nodes on my local machine (JB4.0.4, Win XP, JVM1.4.2) using all the default settings, following the clustered node instructions in the user guide.
|
| After starting both messaging-node0 and messaging-node1 I start my test case (attached).
|
| The first problem I have with the test case that I created is that the message listener does not receive any of the dispatched messages (the test case creates a message dispatcher and message listener - the dispatcher sends a message to a queue that the listener is attached to). This happens regardless of the queue type (i.e. clustered/non-clustered - in this case testDistributedQueue or testQueue).
| The only way I can get the listener to start receiving messages is to kill one of the nodes e.g. kill node0.
|
Looking at your code, I see you are creating the first dispatcher connection to node 0 and the first listener connection to node1. The clustered connection factory will create subsequent connections on different nodes according to (by default) a round robin policy.
JBossMessaging clustering can be configured in different ways according to the type of application you are running.
The most common type of clustered app is a bank of servers with homogenous MDBs deployed on each node (i.e. each node has the same set of MDBs) and producers evenly distributed acros nodes sending messages. In such a configuration it makes sense for the local queue to always get the message - i.e. there is no point redistributing it to another node. This is the default config.
So in your case you are not initially seeing your messages being consumed since your consumer is on a different node to your producer.
When one of the nodes is killed, both connections end up on the same node hence you see the messages being consumed.
There are several different common application "types" and JBM can be configured for all of them. Check out the section on clustering configuration in the 1.2 user guide for more info. The documentation is also due to be fleshed out in more detail soon too.
In short, if your producers are well distributed across the cluster then you should choose the default cluster routing policy which always favours the local queue, otherwise you can use a round robin cluster router policy.
If your consumers are well distributed across the cluster then you do not need message redistribution (i.e. you should use the NullMessagePullPolicy) otherwise you can use the DefaultMessagePullPolicy.
Also bear in mind, that a topolgy where you have just one producer on one node and a single consumer on a different node like your test case is probably not much of a real world scenario, (why would you want to deploy you application this way?), although we should of course cope with this (and we do).
I have successfully run your testcase and I am seeing expected behaviour so far. I have killed alternating servers many times and I am seeing failover occurring fine. We also have a test that runs as part of the cruisecontrol run that does this and it seems to be working.
Can you give me any more details as to what errors you are seeing?
anonymous wrote :
|
| The second issue is that it's pretty easy to stop messages being dispatched and received altogether by randomly stopping and starting the individual nodes e.g. stop both nodes and bring one back up - my test case was unable to get a connection after both nodes had been shut down.
|
|
I don't understand this. In order for the client to successfully send/receive messages you need at least one node in the cluster to be operational.
If you shutdown all the nodes in the cluster then clearly nothing is going to work, the client needs to talk to a server.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026437#4026437
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026437
19Â years, 1Â month
[JBoss Messaging] - UserGuide error in queue destination
by ccfellows
Got a couple exceptions in 8.6.4. Deploying a new destination at http://labs.jboss.com/file-access/default/members/jbossmessaging/freezone...
Changed Queue to QueueService, added a space between element attributes, changed fullSize, pageSize, and downCacheSize to FullSize, PageSize, and DownCacheSize.
| <?xml version="1.0" encoding="UTF-8"?>
| <server>
| <loader-repository>jboss.messaging:loader=ScopedLoaderRepository
| <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
| </loader-repository>
| <mbean
| code="org.jboss.jms.server.destination.QueueService"
| name="jboss.messaging.destination:service=Queue,name=bnincLoggingQueue"
| xmbean-dd="xmdesc/Queue-xmbean.xml">
| <depends optional-attribute-name="ServerPeer">
| jboss.messaging:service=ServerPeer
| </depends>
| <attribute name="SecurityConfig">
| <security>
| <role name="guest" read="true" write="true"/>
| <role name="publisher" read="true" write="true" create="false"/>
| <role name="noacc" read="false" write="false" create="false"/>
| </security>
| </attribute>
| <attribute name="FullSize">75000</attribute>
| <attribute name="PageSize">2000</attribute>
| <attribute name="DownCacheSize">2000</attribute>
| </mbean>
| </server>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026433#4026433
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026433
19Â years, 1Â month
[Clustering/JBoss] - JBoss cluster (UDP) error on AIX 64
by smutchler
I'm trying to setup my first JBoss cluster on AIX (64 bit). I would like to setup the cluster to use unicast but I want to get it working with multicast first. I get the following error on startup:
2007-03-08 16:03:09,854 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: tc5-cluster.aop
| 2007-03-08 16:03:09,854 DEBUG [org.jboss.deployment.SARDeployer] Deploying SAR, start step: url file:/home/smutchle/jboss/server/node2/deploy/tc5-cluster.sar/
| 2007-03-08 16:03:09,854 DEBUG [org.jboss.system.ServiceController] starting service jboss.cache:service=TomcatClusteringCache
| 2007-03-08 16:03:09,854 DEBUG [org.jboss.cache.aop.TreeCacheAop] Starting jboss.cache:service=TomcatClusteringCache
| 2007-03-08 16:03:09,876 ERROR [org.jgroups.JChannel] exception: java.lang.Exception: exception caused by UDP.start(): java.net.SocketException: Can't assign requested address
| 2007-03-08 16:03:09,877 DEBUG [org.jboss.cache.aop.TreeCacheAop] Starting failed jboss.cache:service=TomcatClusteringCache
| ChannelException: java.lang.Exception: exception caused by UDP.start(): java.net.SocketException: Can't assign requested address
|
Here are configuration files:
| <Config>
| <UDP mcast_addr="${jboss.partition.udpGroup:228.1.2.3}" mcast_port="45588"
| ip_ttl="${jgroups.mcast.ip_ttl:8}" ip_mcast="true"
| mcast_recv_buf_size="640000" mcast_send_buf_size="640000"
| ucast_recv_buf_size="640000" ucast_send_buf_size="640000"
| loopback="true"/>
| <PING timeout="2000" num_initial_members="3"
| up_thread="true" down_thread="true"/>
| <MERGE2 min_interval="10000" max_interval="20000"/>
| <FD_SOCK down_thread="false" up_thread="false"/>
| <FD shun="true" up_thread="true" down_thread="true"
| timeout="10000" max_tries="5"/>
| <VERIFY_SUSPECT timeout="3000" num_msgs="3"
| up_thread="true" down_thread="true"/>
| <pbcast.NAKACK gc_lag="50" retransmit_timeout="300,600,1200,2400,4800"
| max_xmit_size="8192"
| up_thread="true" down_thread="true"/>
| <UNICAST timeout="300,600,1200,2400,4800" window_size="100" min_threshold="10"
| down_thread="true"/>
| <pbcast.STABLE desired_avg_gossip="20000" max_bytes="400000"
| up_thread="true" down_thread="true"/>
| <FRAG frag_size="8192"
| down_thread="true" up_thread="true"/>
| <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
| shun="true" print_local_addr="true"/>
| <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
| </Config>
and...
| <config>
| <UDP mcast_addr="230.1.2.7"
| mcast_port="45599"
| ucast_recv_buf_size="20000000"
| ucast_send_buf_size="640000"
| mcast_recv_buf_size="25000000"
| mcast_send_buf_size="640000"
| loopback="true"
| max_bundle_size="8000"
| max_bundle_timeout="30"
| use_incoming_packet_handler="true"
| use_outgoing_packet_handler="true"
| ip_ttl="${jgroups.mcast.ip_ttl:2}"
| down_thread="false" up_thread="false"/>
|
| <PING timeout="2000"
| down_thread="false" up_thread="false" num_initial_members="3"/>
| <MERGE2 max_interval="100000"
| down_thread="false" up_thread="false" min_interval="20000"/>
| <FD_SOCK down_thread="false" up_thread="false"/>
| <FD shun="true" up_thread="false" down_thread="false"
| timeout="20000" max_tries="5"/>
| <VERIFY_SUSPECT timeout="1500"
| up_thread="false" down_thread="false"/>
| <pbcast.NAKACK max_xmit_size="60000"
| use_mcast_xmit="false" gc_lag="50"
| retransmit_timeout="300,600,1200,2400,4800"
| down_thread="false" up_thread="false"
| discard_delivered_msgs="true"/>
| <UNICAST timeout="300,600,1200,2400,3600"
| down_thread="false" up_thread="false"/>
| <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
| down_thread="false" up_thread="false"
| max_bytes="400000"/>
| <pbcast.GMS print_local_addr="true" join_timeout="3000"
| down_thread="false" up_thread="false"
| join_retry_timeout="2000" shun="true"/>
| <FC max_credits="2000000" down_thread="false" up_thread="false"
| min_threshold="0.10"/>
| <FRAG2 frag_size="60000" down_thread="false" up_thread="false"/>
| <pbcast.STATE_TRANSFER down_thread="false" up_thread="false"/>
| </config>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026428#4026428
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026428
19Â years, 1Â month
[JBoss Seam] - Use of Seam Security/drools to selectively load a list?
by JohnEChesher
I have an application where I want users to be able to add other new users IF the new user's role is "less than" that of the current user. By "less than" I mean that the user roles are hierarchical, as in the following roles hierarchy:
Super Admin (can add users w/ role of "Company Admin" or "Client Admin")
| ===> Company Admin (can add users w/ role of "Client Admin")
| ===> Client Admin (cannot add users)
So, on the "Add Users" page, I would like to load up a ListBox of possible roles for the new user with only the roles that the current user is permitted to add. Plus, I would like to do this in a way that is defined outside the Java code, to make maintenance easier, as lower level roles will change over time. I thought I would use drools/JBoss Rules to do this. Here's my code:
This is the ListBox in the view:
<h:selectOneListbox id="roleSelection" value="#{userRole.role}">
| <f:selectItems value="#{maintainUsersAndContacts.roleList}" required="true" />
| </h:selectOneListbox>
Here is the method (in a session bean) that loads SelectItems into an array
public ArrayList<SelectItem> getRoleList() {
| ArrayList<SelectItem> roleNames = new ArrayList<SelectItem>();
| ArrayList<UserRole> roles = (ArrayList<UserRole>) entityManager.createQuery("from UserRole").getResultList();
|
| for (UserRole r : roles) {
| if ( ( ! r.getDisabled()) && ( ! r.getRole().equals("Super Admin"))) {
| if (identity.hasPermission("user", "create", "false")) {
| roleNames.add(new SelectItem(r.getRole()));
| }
| }
| }
| return roleNames;
| }
And here are my drools rules that would apply to this functionality: (Sorry if way off - I'm a drools newbie ;-)
rule CanAddUserOfThisRole
| no-loop
| activation-group "permissions"
| when
| c: PermissionCheck(name == "user", action == "create", granted == false)
| Role(name == "Super Admin")
| then
| c.grant();
| modify(c);
| end;
|
|
| rule CanAddUserOfThisRole2
| no-loop
| activation-group "permissions"
| when
| c: PermissionCheck(name == "user", action == "create", granted == false)
| Role(usersRole : name)
| UserRole(newRole : role -> (newRole.getRole().equals("Client Admin") && usersRole.equals("Company Admin")))
| then
| c.grant();
| modify(c);
| end;
I haven't finished this, as it also involves code changes that will ripple through my project, however, when I reached this point, I started wondering how drools was going to know what "Role" object I was referring to in the following section of the drools code:
UserRole(newRole : role ->
After reading the Security section of the Seam Ref Doc thoroughly, I am now guessing that I am trying to do something that is not possible using the current Seam-1.2-drools integration, but I thought I would reach out to the Seam community for opinions before I abandon the idea.
Is this possible? If so, how do I go about it? Manually outject a Role object immediately before the permission check?
If not possible as I proposed it, does anyone have another idea of how to implement? (Note, after previewing my own post, the idea came to me to put an indicator on the UserRole object indicating it's "place" within the hierarchy. So, if it can't be done with Drools somehow, I'll probably go that route...)
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026424#4026424
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026424
19Â years, 1Â month