You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/10/18 03:01:01 UTC
[GitHub] [incubator-eventmesh] fengyongshe opened a new issue, #1636: [Enhancement] Improve the performance of publish event in connector-pulsar
fengyongshe opened a new issue, #1636:
URL: https://github.com/apache/incubator-eventmesh/issues/1636
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no similar issues.
### Enhancement Request
When pulsar connector receive a event produce event , will construct a new producer instance. It's in a wrong way and poor performance .
```
public void publish(CloudEvent cloudEvent, SendCallback sendCallback) {
try {
Producer<byte[]> producer = this.pulsarClient.newProducer()
.topic(cloudEvent.getSubject())
.batchingMaxPublishDelay(10, TimeUnit.MILLISECONDS)
.sendTimeout(10, TimeUnit.SECONDS)
.blockIfQueueFull(true)
.create();
......
producer.sendAsync(serializedCloudEvent).thenAccept(messageId -> {
sendCallback.onSuccess(CloudEventUtils.convertSendResult(cloudEvent));
});
}
```
As the code above shows , One message one Producer .
### Describe the solution you'd like
1) Construct the producer in init , and put it in the Cache(HashMap)
2) When publish a event, get it from cache
3) If there is need to create a new instance, do as the step one
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org
[GitHub] [incubator-eventmesh] xwm1992 closed issue #1636: [Enhancement] Improve the performance of publish event in connector-pulsar
Posted by GitBox <gi...@apache.org>.
xwm1992 closed issue #1636: [Enhancement] Improve the performance of publish event in connector-pulsar
URL: https://github.com/apache/incubator-eventmesh/issues/1636
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org
[GitHub] [incubator-eventmesh] fengyongshe commented on issue #1636: [Enhancement] Improve the performance of publish event in connector-pulsar
Posted by GitBox <gi...@apache.org>.
fengyongshe commented on issue #1636:
URL: https://github.com/apache/incubator-eventmesh/issues/1636#issuecomment-1284996445
@xwm1992 I'm willing to accomplish it .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org