[Messaging, JMS & JBossMQ] - Re: maxMessages
by Renen
Hi Adrian, thanks for taking the time to reply. I have been chasing ill defined deadlines and wanted to make sure that I answered coherently rather than just shooting my mouth off.
I have re-run my experiments.
> I'd ignore MaxMessages (leave it a 1).
If you don't set this message, the messages are delivered as they are received. Here is an exert from my logging:
| 11:13:55,843 INFO [STDOUT] I will send 2 message which will each execute for ten seconds.
| 11:13:55,890 INFO [STDOUT] Done generating messages.
| 11:13:55,968 INFO [STDOUT] A MDB has been CONSTRUCTED
| 11:13:55,968 INFO [STDOUT] A MDB has been CONSTRUCTED
| 11:13:56,000 INFO [STDOUT] 2: starting
| 11:13:56,000 INFO [STDOUT] 1: starting
| 11:14:06,000 INFO [STDOUT] 1: ending [75778423]
| 11:14:06,000 INFO [STDOUT] 2: ending [89124368]
|
If you set it to one, the messages are delivered one by one:
| 11:16:25,140 INFO [STDOUT] I will send 2 message which will each execute for ten seconds.
| 11:16:25,187 INFO [STDOUT] Done generating messages.
| 11:16:25,250 INFO [STDOUT] A MDB has been CONSTRUCTED
| 11:16:25,265 INFO [STDOUT] 1: starting
| 11:16:35,265 INFO [STDOUT] 1: ending [119664541]
| 11:16:35,281 INFO [STDOUT] 2: starting
| 11:16:45,281 INFO [STDOUT] 2: ending [123000458]
|
> i.e. one message arrives but it will sit there and not be delivered
> until MaxMessages have arrived.
So, I set MaxMessages to 3. Clearly the two messages are delivered without any greater delay than in the preceding two scenarios:
| 11:22:41,093 INFO [STDOUT] I will send 2 message which will each execute for ten seconds.
| 11:22:41,140 INFO [STDOUT] Done generating messages.
| 11:22:41,203 INFO [STDOUT] A MDB has been CONSTRUCTED
| 11:22:41,234 INFO [STDOUT] A MDB has been CONSTRUCTED
| 11:22:41,234 INFO [STDOUT] 1: starting
| 11:22:41,234 INFO [STDOUT] 2: starting
| 11:22:51,234 INFO [STDOUT] 1: ending [84453291]
| 11:22:51,234 INFO [STDOUT] 2: ending [83080051]
|
Which is a huge pity: this control would have allowed me to throttle throughput (which is what I am really trying to do). From what you've said, relying on this behaviour is probably imprudent!
Should I report a bug? Or is my code wrong (its included below)? Otherwise, how should I throttle throughput?
Thank you!
Renen.
Note: I have either eliminated the entire propertyName = "MaxMessages", propertyValue="3" line, or changed the propertyValue setting depending on the scenario (above).
| @MessageDriven(
| mappedName = "jms/TestThroughputConsumer", activationConfig = {
| @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/TestThroughput"),
| @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
| @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
|
| @ActivationConfigProperty(propertyName = "MaxMessages", propertyValue="3")
| }
| )
| public class TestThroughputConsumer implements MessageListener {
|
| public void onMessage(Message message) {
| int id = getIntFromMessage(message);
| System.out.println(id + ": starting");
|
| Date end = new Date( (new Date()).getTime() + 10000 );
| long i = 0;
| while ( (new Date()).before(end) ) {
| i = i+1;
| }
| System.out.println(id + ": ending [" + i + "]");
| }
|
| @PostConstruct
| public void postConstruct() {
| System.out.println("A MDB has been CONSTRUCTED");
| }
|
| @PreDestroy
| public void preDestroy() {
| System.out.println("MDB about to be DESTROYED");
| }
|
| private int getIntFromMessage(Message message) {
| int retval = 0;
| try {
| TestThroughput t = (TestThroughput)((ObjectMessage)message).getObject();
| retval = t.getID();
| } catch (JMSException e) {
| Log.logError(0, "Error extracting message: " + e.getMessage(), this.getClass().getName());
| }
| return retval;
| }
|
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098196#4098196
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098196
18Â years, 8Â months
[Security & JAAS/JBoss] - Problem securing NamingService, InvokerAdaptorService on 4.2
by kasimier
I really tried everything and earned just kidding. Please can anyone help ??
I tried to secure NamingService with AuthenticationInterceptor and UsersRolesLoginModule as described in docs and wiki (including JRMPProxyFactory config for NamingService). It has no effect at all.
Then I tried to secure InvokerAdaptorService with AuthenticationInterceptor and UsersRolesLoginModule. The same problem occured.
I still can retrieve the Naming Proxy, the JRMPInvokerProxy and of course can call invoke() without authentication. There are no log messages or Exceptions about the problem (org.jboss is on DEBUG level).
Sending login information via LoginInitialContextFactory has no effect too. I also have configured SecureConfig, XMLLoginConfig, and JaasSecurityManager in a own SAR and server.log says that they are started successfully. MBean attributes of those services look fine.
Maybe I have not configured depending MBeans?
My server is configured with the following service:
AttributePersistenceService
ThreadPool
Log4jService
NamingBeanImpl
NamingService
JRMPInvoker
JRMPProxyFactory for InvokerAdaptorService
JRMPProxyFactory for NamingService
MBeanProxyRemote
NamingAlias
InvokerAdaptorService
URLDeploymentScanner
TransactionManagerService
WorkManagerThreadPool
WorkManager
RARDeployer
XSLSubDeployer
CachedConnectionManager
WebServer
SecurityConfig
XMLLoginConfig
JaasSecurityManager
one MailService
jboss-local-jdbc.rar
one DataSource
any idea ??
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098192#4098192
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098192
18Â years, 8Â months