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

org.apache.camel.component.rabbitmq.reply.ReplyManager Maven / Gradle / Ivy

There is a newer version: 3.22.3
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.component.rabbitmq.reply;

import java.util.concurrent.ScheduledExecutorService;

import org.apache.camel.AsyncCallback;
import org.apache.camel.Exchange;
import org.apache.camel.component.rabbitmq.RabbitMQEndpoint;


/**
 * The {@link ReplyManager} is responsible for handling request-reply
 * over RabbitMQ.
 *
 * @version 
 */
public interface ReplyManager {

    /**
     * Sets the belonging {@link org.apache.camel.component.jms.JmsEndpoint}.
     */
    void setEndpoint(RabbitMQEndpoint endpoint);
    
    /**
     * Sets the reply to queue the manager should listen for replies.
     * 

* The queue is either a temporary or a persistent queue. */ void setReplyTo(String replyTo); /** * Gets the reply to queue being used */ String getReplyTo(); /** * Register a reply * * @param replyManager the reply manager being used * @param exchange the exchange * @param callback the callback * @param originalCorrelationId an optional original correlation id * @param correlationId the correlation id to expect being used * @param requestTimeout the timeout * @return the correlation id used */ String registerReply(ReplyManager replyManager, Exchange exchange, AsyncCallback callback, String originalCorrelationId, String correlationId, long requestTimeout); /** * Sets the scheduled to use when checking for timeouts (no reply received within a given time period) */ void setScheduledExecutorService(ScheduledExecutorService executorService); /** * Updates the correlation id to the new correlation id. *

* This is only used when useMessageIDasCorrelationID option is used, which means a * provisional correlation id is first used, then after the message has been sent, the real * correlation id is known. This allows us then to update the internal mapping to expect the * real correlation id. * * @param correlationId the provisional correlation id * @param newCorrelationId the real correlation id * @param requestTimeout the timeout */ void updateCorrelationId(String correlationId, String newCorrelationId, long requestTimeout); /** * Process the reply * * @param holder containing needed data to process the reply and continue routing */ void processReply(ReplyHolder holder); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy