[JBoss JIRA] Created: (JBMESSAGING-1081) Allow configuration of distribution policy for queues with multiple consumers
by Julian Scheid (JIRA)
Allow configuration of distribution policy for queues with multiple consumers
-----------------------------------------------------------------------------
Key: JBMESSAGING-1081
URL: http://jira.jboss.com/jira/browse/JBMESSAGING-1081
Project: JBoss Messaging
Issue Type: Feature Request
Components: Messaging Core
Affects Versions: 1.4.0 CR3
Reporter: Julian Scheid
Assigned To: Tim Fox
Priority: Minor
The distribution policy for queues is currently hardwired to RoundRobinDistributor (in MessagingQueue.java) like this:
localDistributor = new DistributorWrapper(new RoundRobinDistributor());
remoteDistributor = new DistributorWrapper(new RoundRobinDistributor());
distributor = new ClusterRoundRobinDistributor(localDistributor, remoteDistributor);
This is a good default for when multiple clients are consuming a queue for purposes of load balancing. However, when there are multiple consumers for purposes of fail-over it can be desirable to use the FirstReceiverDistributor policy instead so that a second consumer only gets messages when the first consumer fails. (I am aware that this is simplifying matters a bit, FirstReceiverDistributor makes no such guarantees.)
This policy can currently only be changed by patching the source code and recompiling. It would be great if it would be possible to configure the distribution policy in a configuration file instead, ideally on a per-queue basis in destinations-service.xml.
This would ideally allow specifying arbitrary class names so that it's possible to install custom distributors.
All of this would obviously be useful for topics as well once JBMESSAGING-377 is implemented.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[JBoss JIRA] Created: (JBMESSAGING-1075) MaxSize attribute being set causes a NullPointerException
by Jay Howell (JIRA)
MaxSize attribute being set causes a NullPointerException
---------------------------------------------------------
Key: JBMESSAGING-1075
URL: http://jira.jboss.com/jira/browse/JBMESSAGING-1075
Project: JBoss Messaging
Issue Type: Bug
Components: Messaging Core
Affects Versions: 1.4.0.CR2
Reporter: Jay Howell
Assigned To: Tim Fox
When the MaxSize is set, a NullPointerException is thrown. In the container, Max size is set in the ManagedDestination before the server peer is set in the managed destination. The server peer is set in the destination when start() is called in DestinationServiceSupport.
Code in the Managed Destination...
public void setMaxSize(int maxSize) throws Exception
{
Condition cond = new JMSCondition(isQueue(), name);
PostOffice postOffice = serverPeer.getPostOfficeInstance();
Collection subs = postOffice.getQueuesForCondition(cond, true);
Iterator iter = subs.iterator();
while (iter.hasNext())
{
Queue queue = (Queue)iter.next();
queue.setMaxSize(maxSize);
}
this.maxSize = maxSize;
}
Code in the DestinationServiceSupport...
public synchronized void startService() throws Exception
{
super.startService();
try
{
serverPeer = (ServerPeer)server.getAttribute(serverPeerObjectName, "Instance");
destination.setServerPeer(serverPeer);
We shouldn't be putting logic like this in our getters and setters. In a pojo Object factory pattern, where we don't have total control over the creation and setting of properties, we should stay away from putting these in our setters. For instance, this function requires that start be called to set the peer before setting the property. We should move the MaxSize property back to a regular property and move this logic into another function called by the start() of the Destination.
In order to reproduce, you only need to put a MaxSize argument in the destination.
ex.
<mbean code="org.jboss.jms.server.destination.TopicService"
name="jboss.messaging.destination:service=Topic,name=testTopic"
xmbean-dd="xmdesc/Topic-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.messaging:service=PostOffice</depends>
<attribute name="SecurityConfig">
<security>
<role name="guest" read="true" write="true"/>
<role name="publisher" read="true" write="true" create="false"/>
<role name="durpublisher" read="true" write="true" create="true"/>
</security>
</attribute>
<attribute name="MaxSize">100000</attribute>
</mbean>
You then get the exception...
13:09:00,190 INFO [ServiceConfigurator] Problem configuring service jboss.messaging.destination:service=Topic,name=testTopic
org.jboss.deployment.DeploymentException: Exception setting attribute javax.management.Attribute@2110fc on mbean jboss.messaging.destination:service=Topic,name=testTopic; - nested throwable: (java.lang.NullPointerException)
at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:698)
at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:332)
at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:460)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
at org.jboss.system.ServiceController.install(ServiceController.java:226)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.install(Unknown Source)
at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:959)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
at org.jboss.jms.server.destination.ManagedDestination.setMaxSize(ManagedDestination.java:280)
at org.jboss.jms.server.destination.DestinationServiceSupport.setMaxSize(DestinationServiceSupport.java:250)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.AttributeDispatcher.invoke(AttributeDispatcher.java:136)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.interceptor.ModelMBeanAttributeInterceptor.invoke(ModelMBeanAttributeInterceptor.java:103)
at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:76)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.setAttribute(AbstractMBeanInvoker.java:461)
at org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerImpl.java:608)
at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:694)
... 85 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[JBoss JIRA] Created: (JBPORTAL-1194) 'Self' producer fails to be registered at server start
by Matt Wringe (JIRA)
'Self' producer fails to be registered at server start
------------------------------------------------------
Key: JBPORTAL-1194
URL: http://jira.jboss.com/jira/browse/JBPORTAL-1194
Project: JBoss Portal
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Portal WSRP
Affects Versions: 2.6.Alpha1
Environment: Linux
1.5.0 JVM
4.0.5 JBoss AS
Reporter: Matt Wringe
Assigned To: Chris Laprun
Attachments: server_output.txt
When the server is started and the portal-wsrp.sar is located within the deploy directory, the portal cannot cannot load the 'self' wsrp producer.
This is due to the portal trying to reference the 'self' producer before 'self' has been bound to the jndi.
15:40:14,739 INFO [WSRPDeploymentFactory] Added consumer for producer 'self'
15:40:14,956 ERROR [STDERR] org.jboss.portal.portlet.InvokerUnavailableException: Problem getting service description for producer self
15:40:14,957 ERROR [STDERR] at org.jboss.portal.wsrp.consumer.ProducerInfo.getServiceDescription(ProducerInfo.java:444)
...
15:40:15,226 ERROR [STDERR] Caused by: javax.naming.NameNotFoundException: wsrp-client not bound
15:40:15,226 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
...
Soon after this step, 'self' becomes bound:
15:40:33,666 INFO [ClientDeployer] Client ENC bound under: wsrp-client
Note: if the wsrp-portal.sar is hot deployed after the server has started, then it will load the producer successfully.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[JBoss JIRA] Created: (JGRP-376) TLS: use priority based queue rather than BoundedLinkedQueue for default thread pool
by Bela Ban (JIRA)
TLS: use priority based queue rather than BoundedLinkedQueue for default thread pool
------------------------------------------------------------------------------------
Key: JGRP-376
URL: http://jira.jboss.com/jira/browse/JGRP-376
Project: JGroups
Issue Type: Feature Request
Affects Versions: 2.4
Reporter: Bela Ban
Assigned To: Bela Ban
Fix For: 2.5
This will allow us to dispatch incoming messages to threads from the pool based on criteria.
- The impl implements interface BoundedChannel
- It has N queues, 1 for each sender (possibly those are BoundedLinkedQueues)
- There is a max size in bytes for the priority queue, each internal queue has max_size / N bytes where N = number of members. This is
dynamically adjusted
ADDITION
- An internal queue maintains the number of bytes (Message.length()), an offer() or put() increases that amount by the size of the message, a
take() or poll() decreases the amount. When a put() or offer() would exceed the max amount, it will block until a take() or poll() decreases
it such that the new message can be added to the queue. We might also discard messages to full queues, or implement somthing akin to
RED (random early detection), which starts discarding messages *before* the queue is full
REMOVAL
- Strategy pluggable, e.g.
- Take from the fullest queue
- Take from the least full queue
- Round robin
- Weighted round robin (weighted by capacity of each queue), e.g. take relative to capacity from each queue. Example:
Queues A (2MB), B (2MB), C (6MB): we take 2 from A, 2 from B and 6 from C
- Random robin
etc
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months