Java Client SDK
Info
This section introduces sending and receiving messages using Apache RocketMQ 5.0 gRPC protocol Java SDK.
info
- This sample code is built based on the gRPC protocol SDK. Therefore, the server needs to be upgraded to at least version 5.0 and enable gRPC Proxy to be compatible. Please refer to the quick start guide for deploying Proxy.
- If you are using the Remoting protocol SDK, it is recommended to refer to the example code of the previous version 4.x for running. To identify the type of SDK you are using, please refer to the overview.
CodeExample
Here is the link to the sample code for message sending and receiving using the Apache RocketMQ gRPC protocol Java SDK. The complete code project and runtime environment can be found in the rocketmq-clients repository. Please refer to it for configuration and running.
MessageTypes | Producer Examples | PushConsumer Examples | SimpleConsumer Examples |
---|---|---|---|
NormalMessage | Sync Send Example:ProducerNormalMessageExample.java Async Send Example:AsyncProducerExample.java | PushConsumerExample.java | Sync Sub Message: SimpleConsumerExample.java Async Sub Message: AsyncSimpleConsumerExample.java |
FIFOMessage | ProducerFifoMessageExample.java | PushConsumerExample.java | Sync Sub Message: SimpleConsumerExample.java Async Sub Message: AsyncSimpleConsumerExample.java |
DelayMessage | ProducerDelayMessageExample.java | PushConsumerExample.java | Sync Sub Message: SimpleConsumerExample.java Async Sub Message: AsyncSimpleConsumerExample.java |
TransactionMessage | ProducerTransactionMessageExample.java | PushConsumerExample.java | Sync Sub Message: SimpleConsumerExample.java Async Sub Message: AsyncSimpleConsumerExample.java |