BroadbandForum / obuspa

OB-USP-AGENT is a system daemon providing a User Services Platform (USP) Agent. https://github.com/BroadbandForum/obuspa/wiki
BSD 3-Clause "New" or "Revised" License
93 stars 62 forks source link

Request to help with STOMP server connectivity #82

Closed M0ulinamary closed 1 year ago

M0ulinamary commented 1 year ago

Do we need to setup STOMP server separately ?

I am following the below commands (It says that connected to SMOP in git repo")

$ obuspa -p -v 4 -r factory_reset_example.txt -i eth0 If OB-USP-AGENT successfully connected to your STOMP server you should see trace like the following on stdout:

Issues: When i try, I don't see such success messages at all .

How to to get it verified ? Any other documentation to setup STOMP server ? i have done setup with single server and executed Agent/control on obusp command.

What other command need to be executed to get STOMP success connection ?

holme-r commented 1 year ago

Do you have a USP Controller setup ? If not, then it won't be able to connect. As part of the USP Controller setup, it may use a STOMP Broker like RabbitMQ with the STOMP plug-in (see rabbitmq.com)

M0ulinamary commented 1 year ago

For testing purpose am trying to make use of obuspa-test-controller. But when i installed, i don't see the 61613 port running. If i want to connect with STOMP server , the current controller setup itself must be in listening mode to 61613 right ? if not, any other steps to achieve this ?

Basically i want to connect to STOMP server, need guidance to get the test stomp server. As you said, i done Controller installation, But still 61613 port not listening.

Can you help on this?

holme-r commented 1 year ago

Please see https://github.com/BroadbandForum/obuspa-test-controller/blob/master/CONTROLLER_SETUP.md. The USP Test Controller actually connects to the STOMP Broker (as does the OBUSPA USP Agent), and the STOMP broker transfers the messages between them. To setup a STOMP Broker see the previous link to rabbitmq.

M0ulinamary commented 1 year ago

Hi Thanks for the response. I have installed STOMP broker using RabbitMQ. And starting the controller using obusap.

When i run obusp command, i get the below header error in STOMP server, Anything need to be modified in factory_reset.txt file ?

Controller Error:

Attempting to connect to host=stomp-server.com (port=5672, unencrypted) from interface=eth0 Connected to stomp-server.com (host=stomp-server.com, port=5672) from interface=eth0 Sending STOMP frame to (host=stomp-server.com, port=5672) STOMP accept-version:1.2 host:/ heart-beat:30000,300000 endpoint-id:os\c\c012345-005056BFF4A4 login:username passcode:

ReceiveStompMessage: STOMP Server read error (host stomp-server.com, port 5672). Retrying. Error on STOMP connection to (host stomp-server.com, port 5672). Closing connection.

Stomp Server Error:: 2023-05-10 11:53:46.238597+00:00 [info] <0.881.0> accepting AMQP connection <0.881.0> (...:40743 -> RabbitMQ IP:5672) 2023-05-10 11:53:46.238892+00:00 [error] <0.881.0> closing AMQP connection <0.881.0> (...:40743 -> RabbitMQ IP:5672): 2023-05-10 11:53:46.238892+00:00 [error] <0.881.0> {bad_header,<<"STOMP\nac">>} 2023-05-10 11:53:49.245501+00:00 [info] <0.886.0> accepting AMQP connection <0.886.0> (...:53641 -> RabbitMQ IP:5672) 2023-05-10 11:53:49.245784+00:00 [error] <0.886.0> closing AMQP connection <0.886.0> (...:53641 -> RabbitMQ IP:5672): 2023-05-10 11:53:49.245784+00:00 [error] <0.886.0> {bad_header,<<"STOMP\nac">>}

M0ulinamary commented 1 year ago

Can you help with the above issue ?

holme-r commented 1 year ago

Did you install and configure the STOMP plug in, as per previous comment ?

M0ulinamary commented 1 year ago

Yes, I have followed the link and completed the STOMP installation in another server, where the ports( 5672/15672) are listening.

But, when i connect to that STOMP server from my Agent/Controller, i get the above pingd error. Am i missing something?

M0ulinamary commented 1 year ago

I have done STOMP setup(Installed RabbitMQ with STOMP plugin enabled) and able to see that 61613 port(STOMP) running fine inside docker container. I have also exposed the 61613 port to the host to access it from my controller/Agent.

My STOMP server status:

docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a23a41f90c58 rabbitmq:3.11-management "docker-entrypoint..." 11 minutes ago Up 11 minutes 4369/tcp, 5671/tcp, 15671/tcp, 15691-15692/tcp, 0.0.0.0:15672->15672/tcp, 25672/tcp, 0.0.0.0:61613->61613/tcp, 0.0.0.0:56->5672/tcp rabbitmq

When I do telnet from the same server to 61613 port, It is failing.

Can you help me to solve this ?

M0ulinamary commented 1 year ago

I solved the 61613 port issue now. Starting agent pointing to STOMP setup(which is running in another server).

When i start agent, i get the below issue.

USP_CONNECT_RECORD sending at time 2023-05-12T11:37:30Z, to host stomp-server.com over STOMP SEND content-length:68 content-type:application/vnd.bbf.usp.msg reply-to-dest:/queue/agent-1 destination:/queue/agent-1 version: "1.2" to_id: "proto::ControllerA" from_id: "os::012345-005056BFACD0" payload_security: PLAINTEXT mac_signature[0] sender_cert[0] stomp_connect { version: V1_2 subscribed_destination: "/queue/agent-1" }

Message received at time 2023-05-12T11:37:30Z, from host stomp-server.com over STOMP MESSAGE subscription:0 destination:/queue/agent-1 message-id:T_0@@session-tqLmamAABrmdsadadlR8JQ@@1 redelivered:false reply-to-dest:/queue/agent-1 content-type:application/vnd.bbf.usp.msg content-length:68 Received 1 heartbeats at time 1683891450 ValidateUspRecord: Ignoring USP record as it was addressed to endpoint_id=proto::ControllerA not os::012345-005056BFACD0

Can you help to solve the connectivity issue from Agent ?

M0ulinamary commented 1 year ago

Since STOMP server connectivity solved in first place, closing the issue. Will open another thread to track the internal issue inside transaction