Package io.micronaut.pulsar.annotation
Annotation Interface PulsarProducer
@Documented
@Retention(RUNTIME)
@Target(METHOD)
@Around
@Introduction
@Type(PulsarProducerAdvice.class)
public @interface PulsarProducer
Marks a method that should produce values to Pulsar topics on call.
- Since:
- 1.0
- Author:
- Haris Secic
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
boolean
int
Default 128KB.int
boolean
boolean
If this is enabled batching should be disabled.org.apache.pulsar.client.api.CompressionType
org.apache.pulsar.client.api.HashingScheme
long
org.apache.pulsar.common.schema.KeyValueEncodingType
If noMessageKey
annotated method argument is detected this attribute is ignored and message is treated as simple - without a key.org.apache.pulsar.client.api.MessageRoutingMode
boolean
boolean
Defaults to false.
-
Element Details
-
value
- Returns:
- Same as
topic()
- Default:
- ""
-
producerName
String producerName- Returns:
- Producer name.
- Default:
- ""
-
topic
- Returns:
- Topic to produce messages to
- Default:
- ""
-
schema
MessageSchema schema- Returns:
- Type of message serialization.
- Default:
- BYTES
-
keySchema
MessageSchema keySchema- Returns:
- Type of message key serialization.
- Default:
- BYTES
-
keyEncoding
org.apache.pulsar.common.schema.KeyValueEncodingType keyEncodingIf noMessageKey
annotated method argument is detected this attribute is ignored and message is treated as simple - without a key.- Returns:
- Whether key will be in the message payload or separate.
- Default:
- INLINE
-
compressionType
org.apache.pulsar.client.api.CompressionType compressionType- Returns:
- Compression type.
- Default:
- NONE
-
messageRoutingMode
org.apache.pulsar.client.api.MessageRoutingMode messageRoutingMode- Returns:
- Message routing mode.
- Default:
- RoundRobinPartition
-
multiSchema
boolean multiSchema- Returns:
- Produce messages of different schemas than specified at creation time
- Default:
- true
-
autoUpdatePartition
boolean autoUpdatePartition- Returns:
- Discover new partitions at runtime
- Default:
- true
-
blockQueue
boolean blockQueue- Returns:
- Multiple calls to send and sendAsync will block if queue full
- Default:
- false
-
batching
boolean batching- Returns:
- Enabled automatic batching of messages
- Default:
- true
-
batchingMaxMessages
int batchingMaxMessages- Returns:
- Max messages in one batch
- Default:
- 1000
-
batchingMaxBytes
int batchingMaxBytesDefault 128KB.- Returns:
- Max bytes per batch
- Default:
- 131072
-
chunking
boolean chunkingIf this is enabled batching should be disabled.- Returns:
- Split messages in chunks if bigger than max allowed size.
- Default:
- false
-
encryptionKey
String encryptionKey- Returns:
- Encryption key to add
- Default:
- ""
-
initialSequenceId
long initialSequenceId- Returns:
- Starting sequence ID for producer
- Default:
- -9223372036854775808L
-
hashingScheme
org.apache.pulsar.client.api.HashingScheme hashingScheme- Returns:
- Change hashing scheme used to choose partition
- Default:
- JavaStringHash
-
sendBefore
boolean sendBeforeDefaults to false. Will be used to determine whether to send message prior to executing method code or after.- Returns:
- Whether to send the message before calling actual implementation.
- Default:
- false
-