001/*-
002 * #%L
003 * HAPI FHIR - Server Framework
004 * %%
005 * Copyright (C) 2014 - 2025 Smile CDR, Inc.
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 *
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package ca.uhn.fhir.rest.server.messaging;
021
022/**
023 * If a Message Listener registered with a Channel Consumer is retry aware, then the Channel Consumer can
024 * pass an instance of this interface to provide delivery context details to the listener. For example,
025 * some listeners may want to handle a request differently if it is being redelivered because the first delivery failed.
026 */
027public interface IMessageDeliveryContext {
028        /**
029         * @return the number of retries for this message delivery. The first delivery has a retry count of 0.
030         */
031        int getRetryCount();
032
033        // TODO KHS lastExceptionType could potentially be useful here as well
034}