-
1. Re: Large number of artimis consumerpages in memory in wildlfy 10
jbertram Feb 27, 2017 6:07 PM (in response to spatwary04)Any message not automatically acknowledged by the session needs to be manually acknowledged by your application.
-
2. Re: Large number of artimis consumerpages in memory in wildlfy 10
spatwary04 Feb 28, 2017 9:25 AM (in response to jbertram)Sorry Justin I did not make it clear we are creating
non transacted JMS Session, with AUTO_ACKNOWLEDGE(acknowledge mode). we have the same code deployed in three server on customer site we are seeing this issue on these servers randomly. we have the same code in our QA environment but did not see this issue.
Below is how we create session on producer side.
s = c.createSession( false, Session.AUTO_ACKNOWLEDGE );
-
3. Re: Large number of artimis consumerpages in memory in wildlfy 10
jbertram Feb 28, 2017 9:37 AM (in response to spatwary04)How are you creating the sessions for consumers?
-
4. Re: Large number of artimis consumerpages in memory in wildlfy 10
spatwary04 Feb 28, 2017 11:08 AM (in response to jbertram)we are using MDB which is consuming the message. Below is the sample code.
Dow we need below annotation ??
@ActivationConfigProperty(propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge"),
@MessageDriven(activationConfig ={
@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Topic"),
@ActivationConfigProperty(propertyName="destination", propertyValue="topic/basketTopic")
})
public class BasketMDB implements MessageListener
private BasketEventProcessorIntf eventProcessor;
/**
* @param msg
*/
@TransactionAttribute( TransactionAttributeType.NOT_SUPPORTED )
public void onMessage( Message msg ){
// call method on stateless ejb with @TransactionAttribute( TransactionAttributeType.REQUIRES_NEW )
// This ejb is does heavy lifting . Does this matter??
eventProcessor.processEvent();
}
-
5. Re: Large number of artimis consumerpages in memory in wildlfy 10
jbertram Feb 28, 2017 11:57 AM (in response to spatwary04)The default ack mode for MDBs is auto-ack, so you don't need to set that explicitly.
Do you have a test-case you can use to reproduce this (even if it doesn't happen all the time)?
-
6. Re: Large number of artimis consumerpages in memory in wildlfy 10
spatwary04 Feb 28, 2017 1:08 PM (in response to jbertram)unfortunately we are unable to reproduce this.. That's why we i am looking at hornet thread as it closely resembles our issue.
-
7. Re: Large number of artimis consumerpages in memory in wildlfy 10
mnovak Mar 1, 2017 3:06 AM (in response to spatwary04)Is BasketEventProcessorIntf stateless session bean doing something with messaging?
Could you share your configuration and code of the producer which is sending the messages to topic?
Thanks,
Mirek
-
8. Re: Large number of artimis consumerpages in memory in wildlfy 10
spatwary04 Mar 1, 2017 3:35 PM (in response to mnovak)Below is the code we are using :
Publisher: we are sending a java object .
public void sendObjectMessage( Serializable object )
{
InitialContext ctx = null;
ConnectionFactory f = null;
Connection c = null;
Destination d = null;
Session s = null;
MessageProducer p = null;
try
{
properties.setProperty( "java.naming.provider.url", "http-remoting://127.0.0.1:1199" );
properties.setProperty( "java.naming.factory.initial", "org.jboss.naming.remote.client.InitialContextFactory" );
properties.setProperty(Context.SECURITY_PRINCIPAL, "test");
// password
properties.setProperty(Context.SECURITY_CREDENTIALS, "test");
ctx = new InitialContext(properties);
f = (ConnectionFactory)ctx.lookup( NOTIFICATION_FACTORY );
d = (Destination)ctx.lookup( destinationId );
c = f.createConnection();
s = c.createSession( false, Session.AUTO_ACKNOWLEDGE );
p = s.createProducer( d );
p.setTimeToLive(6 * 3600 * 1000);
p.setDeliveryMode( DeliveryMode.PERSISTENT );
ObjectMessage objMessage = s.createObjectMessage( object );
p.send( objMessage );
log.finest( "Sent JMS Object Message : " + objMessage );
}
catch ( Exception e )
{
log.log( Level.SEVERE, "Error in sending JMS Object Message : " + object, e );
}
finally
{
try
{
if(p != null)
{
p.close();
}
if(s != null)
{
s.close();
}
if(c != null)
{
c.close();
}
}catch(Exception e)
{
log.severe( e.getMessage() );
}
}
}
Consumer:
@MessageDriven(activationConfig ={
@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Topic"),
@ActivationConfigProperty(propertyName="destination", propertyValue="topic/basketTopic")
})
public class BasketMDB implements MessageListener
private BasketEventProcessorIntf eventProcessor;
/**
* @param msg
*/
@TransactionAttribute( TransactionAttributeType.NOT_SUPPORTED )
public void onMessage( Message msg ){
// call method on stateless ejb with @TransactionAttribute( TransactionAttributeType.REQUIRES_NEW )
// This ejb is does heavy lifting . Does this matter??
eventProcessor.processEvent();
}
@Stateless
@Local(value=BasketEventProcessorIntf.class)
@TransactionAttribute( TransactionAttributeType.REQUIRES_NEW )
public class ASMProgramBasketEventProcessorBean extends BasketEventProcessorBean
implements BasketEventProcessorIntf
{
public processEvent(){
// business logic .
// some heavy listing which will take some time around 2 minutes
}
}
The message size is large. One more thing we are seeing lot of page files being created on the server.
-
9. Re: Large number of artimis consumerpages in memory in wildlfy 10
mnovak Mar 6, 2017 6:18 AM (in response to spatwary04)I played a little with this on WF11 nightly build but could not see the leak you describe.
I have MDB consuming messages from topic (transaction attribute NOT_SUPPORTED) and for each message there is long (30 seconds) call of stateless EJB (transaction attribute REQUIRES_NEW). How long is the EJB call?
Do you have some special config, for example on address settings?