Package org.springframework.pulsar.core
Interface PulsarOperations<T>
- Type Parameters:
T
- the message payload type
- All Known Implementing Classes:
PulsarTemplate
public interface PulsarOperations<T>
The basic Pulsar operations contract.
- Author:
- Chris Bono, Alexander Preuß
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Builder that can be used to configure and send a message. -
Method Summary
Modifier and TypeMethodDescriptionnewMessage
(T message) Create abuilder
for configuring and sending a message.org.apache.pulsar.client.api.MessageId
Sends a message to the specified topic in a blocking manner.org.apache.pulsar.client.api.MessageId
Sends a message to the specified topic in a blocking manner.org.apache.pulsar.client.api.MessageId
Sends a message to the default topic in a blocking manner.org.apache.pulsar.client.api.MessageId
Sends a message to the default topic in a blocking manner.CompletableFuture<org.apache.pulsar.client.api.MessageId>
Sends a message to the specified topic in a non-blocking manner.CompletableFuture<org.apache.pulsar.client.api.MessageId>
Sends a message to the specified topic in a non-blocking manner.CompletableFuture<org.apache.pulsar.client.api.MessageId>
Sends a message to the default topic in a non-blocking manner.CompletableFuture<org.apache.pulsar.client.api.MessageId>
Sends a message to the default topic in a non-blocking manner.
-
Method Details
-
send
org.apache.pulsar.client.api.MessageId send(@Nullable T message) throws org.apache.pulsar.client.api.PulsarClientException Sends a message to the default topic in a blocking manner.- Parameters:
message
- the message to send- Returns:
- the id assigned by the broker to the published message
- Throws:
org.apache.pulsar.client.api.PulsarClientException
- if an error occurs
-
send
org.apache.pulsar.client.api.MessageId send(@Nullable T message, @Nullable org.apache.pulsar.client.api.Schema<T> schema) throws org.apache.pulsar.client.api.PulsarClientException Sends a message to the default topic in a blocking manner.- Parameters:
message
- the message to sendschema
- the schema to use ornull
to send using the default schema resolution- Returns:
- the id assigned by the broker to the published message
- Throws:
org.apache.pulsar.client.api.PulsarClientException
- if an error occurs
-
send
org.apache.pulsar.client.api.MessageId send(@Nullable String topic, @Nullable T message) throws org.apache.pulsar.client.api.PulsarClientException Sends a message to the specified topic in a blocking manner.- Parameters:
topic
- the topic to send the message to ornull
to send to the default topicmessage
- the message to send- Returns:
- the id assigned by the broker to the published message
- Throws:
org.apache.pulsar.client.api.PulsarClientException
- if an error occurs
-
send
org.apache.pulsar.client.api.MessageId send(@Nullable String topic, @Nullable T message, @Nullable org.apache.pulsar.client.api.Schema<T> schema) throws org.apache.pulsar.client.api.PulsarClientException Sends a message to the specified topic in a blocking manner.- Parameters:
topic
- the topic to send the message to ornull
to send to the default topicmessage
- the message to sendschema
- the schema to use ornull
to send using the default schema resolution- Returns:
- the id assigned by the broker to the published message
- Throws:
org.apache.pulsar.client.api.PulsarClientException
- if an error occurs
-
sendAsync
CompletableFuture<org.apache.pulsar.client.api.MessageId> sendAsync(@Nullable T message) throws org.apache.pulsar.client.api.PulsarClientException Sends a message to the default topic in a non-blocking manner.- Parameters:
message
- the message to send- Returns:
- a future that holds the id assigned by the broker to the published message
- Throws:
org.apache.pulsar.client.api.PulsarClientException
- if an error occurs
-
sendAsync
CompletableFuture<org.apache.pulsar.client.api.MessageId> sendAsync(@Nullable T message, @Nullable org.apache.pulsar.client.api.Schema<T> schema) throws org.apache.pulsar.client.api.PulsarClientException Sends a message to the default topic in a non-blocking manner.- Parameters:
message
- the message to sendschema
- the schema to use ornull
to send using the default schema resolution- Returns:
- a future that holds the id assigned by the broker to the published message
- Throws:
org.apache.pulsar.client.api.PulsarClientException
- if an error occurs
-
sendAsync
CompletableFuture<org.apache.pulsar.client.api.MessageId> sendAsync(@Nullable String topic, @Nullable T message) throws org.apache.pulsar.client.api.PulsarClientException Sends a message to the specified topic in a non-blocking manner.- Parameters:
topic
- the topic to send the message to ornull
to send to the default topicmessage
- the message to send- Returns:
- a future that holds the id assigned by the broker to the published message
- Throws:
org.apache.pulsar.client.api.PulsarClientException
- if an error occurs
-
sendAsync
CompletableFuture<org.apache.pulsar.client.api.MessageId> sendAsync(@Nullable String topic, @Nullable T message, @Nullable org.apache.pulsar.client.api.Schema<T> schema) throws org.apache.pulsar.client.api.PulsarClientException Sends a message to the specified topic in a non-blocking manner.- Parameters:
topic
- the topic to send the message to ornull
to send to the default topicmessage
- the message to sendschema
- the schema to use ornull
to send using the default schema resolution- Returns:
- a future that holds the id assigned by the broker to the published message
- Throws:
org.apache.pulsar.client.api.PulsarClientException
- if an error occurs
-
newMessage
Create abuilder
for configuring and sending a message.- Parameters:
message
- the payload of the message- Returns:
- the builder to configure and send the message
-