0

I have a requirement where i need 40 threads to do a certain task (merging) and around 20 threads to do another task(persistence). Merging takes about 5X more time than persistence. I am using message driven beans to accomplish this concurrency.

I created one MDB RecordMerger with the following configuration

@MessageDriven(activationConfig = { 
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
    @ActivationConfigProperty(propertyName = "destination", propertyValue = "testing/RecordMerger"),
    @ActivationConfigProperty(propertyName = "maxSessions", propertyValue = "40")
})

and I did similar thing for persistence

@MessageDriven(activationConfig = { 
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
    @ActivationConfigProperty(propertyName = "destination", propertyValue = "testing/RecordPersistor"),
    @ActivationConfigProperty(propertyName = "maxSessions", propertyValue = "20")
})

My configuration in tomee.xml is as follows

 <Container id="MyJmsMdbContainer" ctype="MESSAGE">
    ResourceAdapter = MyJmsResourceAdapter
    InstanceLimit = 40
</Container>

The recordmerging queue has a very fast production, so there are always new elements in record merging queue. Record merging queue puts the data in Record Persistence queue.

The problem that i am facing is that when record merger has been configured to use 40 threads, my tomee server does not instantiates record persistence MDB, which results in records being piled up in that queue. If i reduce the maxSession property of record merger to 20, both the MDB's start getting instantiated.

Can any one please guide me what i need to do to ensure that both MDB's are running and record merger is having 40 threads.

vishva
  • 366
  • 5
  • 17

1 Answers1

0

you likely also need to set threadPoolSize=40 (default to 30) in the resource adapter definition (tomee.xml)

Romain Manni-Bucau
  • 3,354
  • 1
  • 16
  • 13