fabian4 commented on PR #4393:
URL: https://github.com/apache/eventmesh/pull/4393#issuecomment-1690120681

   It works just fine here when I do my part here. 
   But the `RabbitMQSinkConnector` as the rabbitmq-producer in 
eventmesh-storage-rabbitmq doesn't work at the first time. We need to bind 
channel with exchangeName and queueName like we do it in the rabbiotmq-consumer 
 Just in case we connect the rabbitmq-server for the first time without 
creating a binding in rabbitmq-server manually.
   ```java
     rabbitmqClient.binding(channel, 
sinkConfig.getConnectorConfig().getExchangeType(), 
           sinkConfig.getConnectorConfig().getExchangeName(),  
           sinkConfig.getConnectorConfig().getRoutingKey(), 
           sinkConfig.getConnectorConfig().getQueueName());
   ```
   
   ## To verify `RabbitMQSinkConnector`
   
   1. launch your rabbitmq server and eventmesh-runtime.
   2. enable sinkConnector and check `sink-config.yml`.
   ```yml
   pubSubConfig:  
     meshAddress: 127.0.0.1:10000  
     subject: TopicTest  
     idc: FT  
     env: PRD  
     group: rabbitmqSink  
     appId: 5031  
     userName: rabbitmqSinkUser  
     passWord: rabbitmqPassWord  
   connectorConfig:  
     connectorName: rabbitmqSink  
     host: your.rabbitmq.server
     port: 5672  
     username: coyrqpyz  
     passwd: passwd 
     virtualHost: coyrqpyz  
     exchangeType: TOPIC  
     # build-in exchangeName or name a new one after you create it in rabbitmq 
server.
     exchangeName: amq.topic  
     # rabbitmq server will create the routingKey and queueName automatically 
after you connect to it if they aren't exist before.
     routingKey: eventmesh  
     queueName: eventmesh  
     autoAck: true
   ```
   3. start your `RabbitMQConnectorServer` and you will find the channel in 
rabbitmq server.
   <img width="1233" alt="image" 
src="https://github.com/apache/eventmesh/assets/60428924/44f9fd73-477f-4ec6-9ed4-e9e0705da6af";>
   <img width="1014" alt="image" 
src="https://github.com/apache/eventmesh/assets/60428924/e60b1d99-add7-4e44-af5a-86023ec7c833";>
   
   4. send a message to the Topic `TopicTest` as you defined above and check 
the result it rabbit console.
   <img width="1052" alt="image" 
src="https://github.com/apache/eventmesh/assets/60428924/f21669fb-2579-4cb1-9136-c11e01101b64";>
   
   <img width="1089" alt="image" 
src="https://github.com/apache/eventmesh/assets/60428924/8b3f249d-adbf-4776-a323-c3f8a50dc375";>
   
   ## To verify `RabbitMQSourceConnector`
   1. launch your rabbitmq server and eventmesh-runtime.
   2. enable sourceConnector and check `source-config.yml` (Basically the same 
as `sink-config.yml`)
   3. start your `RabbitMQConnectorServer` and you will find the channel in 
rabbitmq server.
   4. put a cloudevent message to queue. Then it will be send to eventmesh, you 
can check it by log or in eventmesh-dashboard
   ```json
   
{"version":"V1","data":"{\"content\":\"testAsyncMessage\"}","extensions":{"protocolversion":"1.0","reqeventmesh2mqtimestamp":"1692799850158","rsp0idc":"FT","datacontenttype":"application/cloudevents+json","subject":"TopicTest","reqsendeventmeship":"[fe80:0:0:0:261b:aa79:91fe:28f3%utun2]","reqreceiveeventmeship":"[fe80:0:0:0:261b:aa79:91fe:28f3%utun2]","protocoldesc":"tcp","rsp0sys":"5031","source":"/","type":"cloudevents","ttl":"30000","reqeventmesh2ctimestamp":"1692799850775","reqmq2eventmeshtimestamp":"1692799850771","rsp0ip":"127.0.0.1","protocoltype":"cloudevents","rsp0group":"rabbitmqSink","id":"06315467-9624-47d7-b751-d7e4cd04b452","reqc2eventmeshtimestamp":"1692799850091"}}
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to