You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2023/01/30 15:58:00 UTC
[jira] [Updated] (ARTEMIS-4148) Too many open files in ims consumer
[ https://issues.apache.org/jira/browse/ARTEMIS-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Justin Bertram updated ARTEMIS-4148:
------------------------------------
Description:
After upgrade from 2.24.0 to current release we see the following error:
{noformat}
Caused by: io.netty.channel.ChannelException: io.netty.channel.unix.Errors$NativeIoException: newSocketStream(..) failed: Too many open files{noformat}
This our code:
{code:java}
public void process(long receiveTimeout) {
Connection jmsConnection = null;
try {
jmsConnection = connectionFactory.createConnection();
jmsConnection.start();
} catch (RuntimeException | JMSException e) {
// rolling back the batch
closeConnection(jmsConnection);
throw new ConsumerException("batch processing", e);
}
try (Session jmsSession = jmsConnection.createSession(true, Session.AUTO_ACKNOWLEDGE)) {
Queue q = jmsSession.createQueue(queueName);
try (MessageConsumer messageConsumer = jmsSession.createConsumer(q)) {
...
jmsSession.commit();
} catch (JMSException e) {
throw new ConsumerException("batch processing", e);
} finally {
closeConnection(jmsConnection);
}
}{code}
was:
After upgrade from 2.24.0 to current release we see the following error:
Caused by: io.netty.channel.ChannelException: io.netty.channel.unix.Errors$NativeIoException: newSocketStream(..) failed: Too many open files
This our code
{color:#000080}public void {color}process({color:#000080}long {color}receiveTimeout) {
Connection jmsConnection = {color:#000080}null{color};
{color:#000080}try {color}{
jmsConnection = {color:#660e7a}connectionFactory{color}.createConnection();
jmsConnection.start();
} {color:#000080}catch {color}(RuntimeException | JMSException e) {
{color:#808080}// rolling back the batch
{color}{color:#808080} {color}closeConnection(jmsConnection);
{color:#000080}throw new {color}ConsumerException({color:#008000}"batch processing"{color}, e);
}
{color:#000080}try {color}(Session jmsSession = jmsConnection.createSession({color:#000080}true{color}, Session.{color:#660e7a}AUTO_ACKNOWLEDGE{color})) {
Queue q = jmsSession.createQueue({color:#660e7a}queueName{color});
{color:#000080}try {color}(MessageConsumer messageConsumer = jmsSession.createConsumer(q)) {
....
jmsSession.commit();
} {color:#000080}catch {color}(JMSException e) {
{color:#000080}throw new {color}ConsumerException({color:#008000}"batch processing"{color}, e);
} {color:#000080}finally {color}{
closeConnection(jmsConnection);
}
}
> Too many open files in ims consumer
> -----------------------------------
>
> Key: ARTEMIS-4148
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4148
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: JMS
> Affects Versions: 2.27.1
> Reporter: Juergen Melzer
> Priority: Major
>
> After upgrade from 2.24.0 to current release we see the following error:
> {noformat}
> Caused by: io.netty.channel.ChannelException: io.netty.channel.unix.Errors$NativeIoException: newSocketStream(..) failed: Too many open files{noformat}
> This our code:
> {code:java}
> public void process(long receiveTimeout) {
> Connection jmsConnection = null;
> try {
> jmsConnection = connectionFactory.createConnection();
> jmsConnection.start();
> } catch (RuntimeException | JMSException e) {
> // rolling back the batch
> closeConnection(jmsConnection);
> throw new ConsumerException("batch processing", e);
> }
> try (Session jmsSession = jmsConnection.createSession(true, Session.AUTO_ACKNOWLEDGE)) {
> Queue q = jmsSession.createQueue(queueName);
> try (MessageConsumer messageConsumer = jmsSession.createConsumer(q)) {
> ...
> jmsSession.commit();
> } catch (JMSException e) {
> throw new ConsumerException("batch processing", e);
> } finally {
> closeConnection(jmsConnection);
> }
> }{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)