mionker commented on code in PR #27173: URL: https://github.com/apache/camel/pull/27173#discussion_r4221924631
########## components/camel-sjms/src/main/java/org/apache/camel/component/sjms/consumer/BatchMessageListenerContainer.java: ########## @@ -0,0 +1,156 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.sjms.consumer; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.locks.ReentrantLock; + +import jakarta.jms.JMSException; +import jakarta.jms.MessageConsumer; +import jakarta.jms.Session; + +import org.apache.camel.component.sjms.SjmsEndpoint; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class BatchMessageListenerContainer extends SimpleMessageListenerContainer { + + private static final Logger LOG = LoggerFactory.getLogger(BatchMessageListenerContainer.class); + + private final SjmsEndpoint endpoint; + private BatchEndpointMessageListener batchListener; + private ExecutorService workerExecutorService; + private final ReentrantLock workersLock = new ReentrantLock(); + private final List<BatchConsumerWorker> workers = new ArrayList<>(); + private volatile boolean stopping; + + public BatchMessageListenerContainer(SjmsEndpoint endpoint) { + super(endpoint); + this.endpoint = endpoint; + this.stopping = false; + } + + public void setBatchListener(BatchEndpointMessageListener batchListener) { + this.batchListener = batchListener; + } + + @Override + protected void doStart() throws Exception { Review Comment: I am of the impression that the container is destroyed by the SjmsConsumer when doStop is called, and therefore the status would be irrelevant. I will nonetheless switch to use the BaseService status. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
