Skip to content

Commit

Permalink
Update producer_example page. (apache#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
RocMarshal committed May 10, 2021
1 parent 686ca06 commit 66a5a92
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions docs/zh-cn/producer_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactor
- TubeSingleSessionFactory 在整个生命周期只会创建一个 session
- TubeMultiSessionFactory 每次调用都会创建一个session

### TubeSingleSessionFactory
#### Send Message Synchronously
1. TubeSingleSessionFactory
- Send Message Synchronously
```java
public final class SyncProducerExample {

Expand All @@ -28,10 +28,10 @@ TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactor
}
messageProducer.shutdown();
}
}
```
}
```
#### Send Message Asynchronously
- Send Message Asynchronously
```java
public final class AsyncProducerExample {

Expand Down Expand Up @@ -62,10 +62,10 @@ TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactor
messageProducer.shutdown();
}

}
```
}
```
#### Send Message With Attributes
- Send Message With Attributes
```java
public final class ProducerWithAttributeExample {

Expand All @@ -87,11 +87,9 @@ TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactor
messageProducer.sendMessage(message);
messageProducer.shutdown();
}

}
```
}```
### TubeMultiSessionFactory
- TubeMultiSessionFactory

```java
public class MultiSessionProducerExample {
Expand Down

0 comments on commit 66a5a92

Please sign in to comment.