001/*-
002 * #%L
003 * Smile CDR - CDR
004 * %%
005 * Copyright (C) 2016 - 2025 Smile CDR, Inc.
006 * %%
007 * All rights reserved.
008 * #L%
009 */
010package ca.cdr.api.broker;
011
012import ca.uhn.fhir.rest.server.messaging.IMessage;
013
014import java.util.Map;
015
016public interface IPublicBrokerSendRequest<P> {
017        /**
018         * Allows sending a plain string payload with headers to the configured broker.
019         *
020         * @param theTopic       the Topic
021         * @param thePayload     message payload
022         * @param theMessageType the message type class that should be sent to the broker (determines payload and header serialization)
023         * @param thePayloadType type of the thePayload
024         * @param theHeaders     the message headers
025         * @throws Exception     if an error occurs during message sending
026         */
027        /**
028         * @return the Broker topic
029         */
030        String getChannelName();
031
032        P getPayload();
033
034        Class<? extends IMessage<P>> getMessageType();
035
036        Class<P> getPayloadType();
037
038        Map<String, Object> getHeaders();
039}