All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.camel.processor.aggregate.PreCompletionAwareAggregationStrategy Maven / Gradle / Ivy

There is a newer version: 4.6.0
Show newest version
/**
 * 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.processor.aggregate;

import org.apache.camel.Exchange;

/**
 * A specialized {@link org.apache.camel.processor.aggregate.AggregationStrategy} which enables the aggregator to run
 * in pre-completion mode. This allows the {@link #preComplete(org.apache.camel.Exchange, org.apache.camel.Exchange)} method
 * to control the completion. Only completion timeout or interval can also be used; any other completion configuration
 * is not in use.
 * 

* Using this strategy supports the use-case, where an incoming Exchange has information that may trigger the completion * of the current group. And then use the new incoming Exchange to start a new group thereafter from scratch. */ public interface PreCompletionAwareAggregationStrategy extends AggregationStrategy { /** * Determines if the aggregation should complete the current group, and start a new group, or the aggregation * should continue using the current group. * * @param oldExchange the oldest exchange (is null on first aggregation as we only have the new exchange) * @param newExchange the newest exchange (can be null if there was no data possible to acquire) * @return true to complete current group and start a new group, or false to keep using current */ boolean preComplete(Exchange oldExchange, Exchange newExchange); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy