IPCConnectedFactoryExchange / CFX

Apache License 2.0
75 stars 69 forks source link

Are there instructions for settings up an amqp broker? #19

Open steve7203 opened 5 years ago

steve7203 commented 5 years ago

I would like to be able to host the amqp service myself, with something like RabbitMQ. Has anyone been able to use this with anything other than the amqp://cfx.aiscorp.com:5672 broker? I've tried setting settings up an exchange/queue that has similar naming, but none of the messages seem to come through. I'd appreciate any insight anyone could give me into this. Thanks!

KevinHunter12 commented 5 years ago

Ive not set up a RabbitMQ server yet but I have successfully sent messages to the demo webpage ( http://www.connectedfactoryexchange.com/CFXDemo/CFXDemo ) .

The broker is: amqp://cfxbroker.connectedfactoryexchange.com The exchange is /exchange/AegisCloud

You can pick a handle that matches one of the machines in the demo page and you will see the data in the page (I sent status change messages).

Eg if you pick the Siplace SX then the Handle is listed on the webpage as: ASM.SIPLACE.SX2

Hope this helps. The only thing I cant work out so far is where to find the queue names so i can subscribe to the data. Kevin

engrx2019 commented 5 years ago

Is the demo page still working and can I send messages to it? How can I get my own handle? Is there another way to test my software?

Thanks

simon-smith commented 5 years ago

Steve did you ever get anywhere with setting up your own RabbitMQ broker? I have also been trying and have run into a few issues. Firstly RabbitMQ only supports AMQP0.9.1 out of the box. You need to add the AMQP1.0 plug-in. I modifed my CFX output to use the RabbitMQ Client API. This uses 0.9.1 protocol and then messages appeared on the broker. AMQP1.0 is my next aim. Also if you don't getting 'routing' correct messages also appear to vanish. I hope this helps. Simon

simon-smith commented 5 years ago

I would like to be able to host the amqp service myself, with something like RabbitMQ. Has anyone been able to use this with anything other than the amqp://cfx.aiscorp.com:5672 broker? I've tried setting settings up an exchange/queue that has similar naming, but none of the messages seem to come through. I'd appreciate any insight anyone could give me into this. Thanks!

Hi Steve

I finally got my RabbitMQ to accept CFX connections and messages. There are a few things you need to know/setup for successful transmissions.

  1. Make sure you have the AMQP 1.0 plug-in installed and enabled.
  2. The exchange that will receive your messages must be configured as a 'fanout' exchange.
  3. The queues bound to this exchange appear to need a routing value as well. I just set mine to the same name as the queue.
  4. When you configure your CFX output you need to make sure you pass the exhange name as: '/exchange/YOUREXCHANGENAME'. The /exchange/ part is perculier to RabbitMQ
  5. For queue name setting you need to do the same as 4, but with /queue/ as the beginning. I hope this helps. Simon
sahendrapang commented 4 years ago

I would like to be able to host the amqp service myself, with something like RabbitMQ. Has anyone been able to use this with anything other than the amqp://cfx.aiscorp.com:5672 broker? I've tried setting settings up an exchange/queue that has similar naming, but none of the messages seem to come through. I'd appreciate any insight anyone could give me into this. Thanks!

Hi Steve I finally got my RabbitMQ to accept CFX connections and messages. There are a few things you need to know/setup for successful transmissions.

Make sure you have the AMQP 1.0 plug-in installed and enabled. The exchange that will receive your messages must be configured as a 'fanout' exchange. The queues bound to this exchange appear to need a routing value as well. I just set mine to the same name as the queue. When you configure your CFX output you need to make sure you pass the exhange name as: '/exchange/YOUREXCHANGENAME'. The /exchange/ part is perculier to RabbitMQ For queue name setting you need to do the same as 4, but with /queue/ as the beginning. I hope this helps. Simon

Dear Simon,

how about the broker name? "amqp://localhost:5672" ?

Thanks

simon-smith commented 4 years ago

Dear Simon,

how about the broker name? "amqp://localhost:5672" ?

Thanks

Hi Have you looked at the RabbitMQ setup document on the IPC-CFX website? This gives you step-by-step instructions on how to create your own message broker. https://cfx.ipc.org/files/IPC-CFX-AMQP-Guide-v1_0.pdf With regards to the URL I used: amqp://127.0.0.1:5672 initially. Then I used a second PC for the broker (just to separate the CFX development PC from the broker) and used the local network address of the PC instead of 127.0.0.1. Don't forget to make sure you open the ports on your PC firewall. I hope this helps. Simon

HaythemLtifi commented 3 years ago

Hello ,I am i late for the party ? So basically i managed to send msgs to the Rabbitmq broker on my local machine the problem is the format that i see the msg in it , its set to application/json; charset="utf-8" content_encoding: | gzip But this is what my payload looks like : H4sIAAAAAAAEAGVPTU/DMAz9K5PFjaZz3JSOHAFN4wAHNiauWeNNldp0pKnENO2/42qIyy6W/Pw+/M7wxsPgDvzuOgYLz8uvfMUuph27BBlsOQ5NH+Si80L2 TdPxOrnuKAghaYUPivRGoy1Kayivqooeie5RW0Thf4bme+TXF6EbQ64wnpVDXypDtFA7X+8V4qLyJRIV6EWx7sdYT6/M5qIceV7vf6ZgFw+cwIaxbTP4YLkN afK9An8tnnp/AnuGu3Q63tTJZrKKlcyVC769DfmnLuMUEGoxA0R7bXO5/AL9DBw5LgEAAA==

How is that json related and how can i work with it?

HaythemLtifi commented 3 years ago

For the future generation don't worry if what you see are garbage . just use the cfx free demo page to view your data and you can make an endpoint that subscribe to the same Queue and read the messages. of course make your own server using Rabbitmq and AMQP v1 that part i easy . to configure the subscribe channel have a look at the free demo c# projects they will guide you. the exact solution is not there but you can do it even with 0 knowledge on c# just google the errors.

lifunning commented 1 year ago

Hello ,I am i late for the party ? So basically i managed to send msgs to the Rabbitmq broker on my local machine the problem is the format that i see the msg in it , its set to application/json; charset="utf-8" content_encoding: | gzip But this is what my payload looks like : H4sIAAAAAAAEAGVPTU/DMAz9K5PFjaZz3JSOHAFN4wAHNiauWeNNldp0pKnENO2/42qIyy6W/Pw+/M7wxsPgDvzuOgYLz8uvfMUuph27BBlsOQ5NH+Si80L2 TdPxOrnuKAghaYUPivRGoy1Kayivqooeie5RW0Thf4bme+TXF6EbQ64wnpVDXypDtFA7X+8V4qLyJRIV6EWx7sdYT6/M5qIceV7vf6ZgFw+cwIaxbTP4YLkN afK9An8tnnp/AnuGu3Q63tTJZrKKlcyVC769DfmnLuMUEGoxA0R7bXO5/AL9DBw5LgEAAA==

How is that json related and how can i work with it?

Hi HaythemLtifi, did you solve the issue, I also have this problem, message in payload is error code and can't decode...

a-c-g89 commented 1 year ago

Hello ,I am i late for the party ? So basically i managed to send msgs to the Rabbitmq broker on my local machine the problem is the format that i see the msg in it , its set to application/json; charset="utf-8" content_encoding: | gzip But this is what my payload looks like : H4sIAAAAAAAEAGVPTU/DMAz9K5PFjaZz3JSOHAFN4wAHNiauWeNNldp0pKnENO2/42qIyy6W/Pw+/M7wxsPgDvzuOgYLz8uvfMUuph27BBlsOQ5NH+Si80L2 TdPxOrnuKAghaYUPivRGoy1Kayivqooeie5RW0Thf4bme+TXF6EbQ64wnpVDXypDtFA7X+8V4qLyJRIV6EWx7sdYT6/M5qIceV7vf6ZgFw+cwIaxbTP4YLkN afK9An8tnnp/AnuGu3Q63tTJZrKKlcyVC769DfmnLuMUEGoxA0R7bXO5/AL9DBw5LgEAAA== How is that json related and how can i work with it?

Hi HaythemLtifi, did you solve the issue, I also have this problem, message in payload is error code and can't decode...

Same. Any information on this?