-
Notifications
You must be signed in to change notification settings - Fork 19
Suggested changes to use IP address #1
base: master
Are you sure you want to change the base?
Conversation
NOTE: this is COMPLETELY untested as I can't build the project on my workstation. |
The error is very clear -
Like I said, this is completely untested code. I didn't put a prototype for that constructor into this file. I will fix this error but from here on out you're on your own 😺 |
Thank you for everything Luke. [ 93%] Building CXX object src/CMakeFiles/send.dir/send.cpp.o |
Remove |
Thank you! I've modified 'send'. Mainly just changing the ip address to my current one and 5672 to 15672 #include "SimplePocoHandler.h" int main(void)
} |
I've tried both localhost and an IP address but nothing is showing up in the rmq management console/plugin plus I never get the confirmation [X] Sent Hello World in the terminal. |
You need to make sure you are publishing to a queue that exists and that this code is correct:
|
You should also check your RabbitMQ server logs to ensure that a connection is actually being recorded. You may consider running Wireshark to view traffic on port 5672 |
This queue exists on the ip address (10.110.147.224) I am entering. |
I've also just created the queue "Raphael" on localhost but still, it receives nothing |
Why are you using port 15672? That is typically the management API port. Are you certain you are using the same values as your Java code? Again, without more information I can only suggest doing a packet capture and comparing your successful Java app with this one. |
You're right I should be using 5672. It is not specified in my Java code (below), but it is using it by default. When using 5672 in the C++ code it executes with 10.110.147.224, , but again nothing shows up in the queue. I've installed wireshark and when using the UI, I filtered by amqp nothing comes up. 3755 394.469380600 10.110.25.150 10.110.147.224 TCP 74 [TCP Retransmission] 36912 → 5672 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=173473758 TSecr=0 WS=128
|
After doing more research it seems that this has to do with my firewall. Now I am trying to see how to open up the ports on my PC. |
Ok it was the firewall. After restarting I no longer have that issue. However I am getting I've attached my wireshark file in this thread Can you tell me what is going wrong? Wireshark Packet Summaries: 10 0.137072440 192.168.137.72 192.168.137.127 TCP 74 51138 → 5672 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=680864689 TSecr=0 WS=128 20 0.150815883 192.168.137.127 192.168.137.72 TCP 66 5672 → 51138 [SYN, ACK] Seq=0 Ack=1 Win=17520 Len=0 MSS=1460 WS=256 SACK_PERM=1 21 0.151000159 192.168.137.72 192.168.137.127 TCP 54 51138 → 5672 [ACK] Seq=1 Ack=1 Win=29312 Len=0 22 0.151602105 192.168.137.72 192.168.137.127 AMQP 62 Protocol-Header 0-9-1 23 0.168308764 192.168.137.127 192.168.137.72 AMQP 546 Connection.Start 24 0.168486582 192.168.137.72 192.168.137.127 TCP 54 51138 → 5672 [ACK] Seq=9 Ack=493 Win=30336 Len=0 55 10.179104049 192.168.137.127 192.168.137.72 TCP 54 5672 → 51138 [RST, ACK] Seq=493 Ack=9 Win=0 Len=0 |
At this point there's most likely a bug in this code. You can see that the connection appears to be established and the AMQP handshake completed, but then your code stalls. I suggest comparing this packet capture with one from the Java application you mention to see where the difference lies. If you're not aware, AMQP-CPP has a much newer version here, with some examples here. I would recommend using one of their suggested event loops rather than coding your own. |
I've added a packet reading screenshot here: I've replaced the AMQP-CPP files with the newest versions but I still get the same error. |
That is because this code has a bug in how it reads or writes to the socket. I suggested the The screenshot proves that your RabbitMQ environment is working correctly because your Java program is working correctly. At this point I no longer have the time to provide free assistance. If my time allows, I may try to get this code running on my Linux workstation to debug further, but I can't make any guarantees. |
https://stackoverflow.com/q/50402938/1466825