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ß, Jonas Geiregat
-
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
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:
PulsarException
- if anyPulsarClientException
occurs communicating with Pulsar
-
send
org.apache.pulsar.client.api.MessageId send(@Nullable T message, @Nullable org.apache.pulsar.client.api.Schema<T> schema) 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:
PulsarException
- if anyPulsarClientException
occurs communicating with Pulsar
-
send
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:
PulsarException
- if anyPulsarClientException
occurs communicating with Pulsar
-
send
org.apache.pulsar.client.api.MessageId send(@Nullable String topic, @Nullable T message, @Nullable org.apache.pulsar.client.api.Schema<T> schema) 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:
PulsarException
- if anyPulsarClientException
occurs communicating with Pulsar
-
sendAsync
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:
PulsarException
- if anyPulsarClientException
occurs communicating with Pulsar
-
sendAsync
CompletableFuture<org.apache.pulsar.client.api.MessageId> sendAsync(@Nullable T message, @Nullable org.apache.pulsar.client.api.Schema<T> schema) 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:
PulsarException
- if anyPulsarClientException
occurs communicating with Pulsar
-
sendAsync
CompletableFuture<org.apache.pulsar.client.api.MessageId> sendAsync(@Nullable String topic, @Nullable T message) 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:
PulsarException
- if anyPulsarClientException
occurs communicating with Pulsar
-
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 PulsarException 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:
PulsarException
- if anyPulsarClientException
occurs communicating with Pulsar
-
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
-