stomp-js / rx-stomp

STOMP adaptor for RxJS
Apache License 2.0
110 stars 21 forks source link

Sample under ingress minikube not works #544

Open masalinas opened 8 months ago

masalinas commented 8 months ago

Right now I have this solution deployed in kubernetes (minikube with ingress activated and configured):

These are my end-to-end tests and results

client.js:285 WebSocket connection to 'ws://minikube.io/poc-backend/ws' failed: 
_createWebSocket @ client.js:285
(anonymous) @ client.js:218
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:22
invoke @ zone.js:368
onInvoke @ core.mjs:11061
invoke @ zone.js:367
run @ zone.js:129
(anonymous) @ zone.js:1257
invokeTask @ zone.js:402
(anonymous) @ core.mjs:10735
onInvokeTask @ core.mjs:10735
invokeTask @ zone.js:401
onInvokeTask @ core.mjs:11048
invokeTask @ zone.js:401
runTask @ zone.js:173
drainMicroTaskQueue @ zone.js:581
invokeTask @ zone.js:487
ZoneTask.invoke @ zone.js:472
data.args.<computed> @ zone.js:2347
Show 20 more frames
rx-stomp.config.ts:33 Mon Oct 30 2023 12:36:51 GMT+0100 (hora estándar de Europa central) 'Connection closed to ws://minikube.io/poc-backend/ws'
rx-stomp.config.ts:33 Mon Oct 30 2023 12:36:51 GMT+0100 (hora estándar de Europa central) 'STOMP: scheduling reconnection in 500ms'
rx-stomp.config.ts:33 Mon Oct 30 2023 12:37:42 GMT+0100 (hora estándar de Europa central) 'Opening Web Socket...'

As you see only when the ingress is in the middle the back and front the connection is not established, but however using postman it works. Also I don't have any detail error to discover the origin of the error, so my question is:

This is my log from ingress controller when I can't connect to backend throw ingress

172.23.0.1 - - [30/Oct/2023:13:06:36 +0000] "GET /poc-backend/ws HTTP/1.1" 308 164 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" 554 0.000 [default-poc-uniovi-avib-data-projection-backend-8080] [] - - - - e48ee5984470f7686e8aabf47b3e5877

And this log is when connect from Postman correctly:

172.23.0.1 - - [30/Oct/2023:13:35:19 +0000] "GET /poc-backend/ws HTTP/1.1" 101 4 "-" "-" 234 26.471 [default-poc-uniovi-avib-data-projection-backend-8080] [] 172.17.0.4:8080 0 26.468 101 9f7600aae958e6e940767f3159a74bff

Also logs from my Springboot backend service:


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.1.4)

2023-10-30T09:31:13.363Z  INFO 1 --- [           main] ioviAvibDataProjectionBackendApplication : Starting PocUnioviAvibDataProjectionBackendApplication v0.0.1-SNAPSHOT using Java 17-ea with PID 1 (/opt/app/app.jar started by root in /opt/app)
2023-10-30T09:31:13.366Z  INFO 1 --- [           main] ioviAvibDataProjectionBackendApplication : The following 1 profile is active: "avib"
2023-10-30T09:31:18.050Z  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Elasticsearch repositories in DEFAULT mode.
2023-10-30T09:31:18.144Z  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 82 ms. Found 0 Elasticsearch repository interfaces.
2023-10-30T09:31:18.159Z  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Reactive Elasticsearch repositories in DEFAULT mode.
2023-10-30T09:31:18.160Z  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 1 ms. Found 0 Reactive Elasticsearch repository interfaces.
2023-10-30T09:31:20.627Z  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-10-30T09:31:20.651Z  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-10-30T09:31:20.652Z  INFO 1 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.13]
2023-10-30T09:31:21.234Z  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-10-30T09:31:21.240Z  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 7606 ms
2023-10-30T09:31:26.293Z  INFO 1 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 1 endpoint(s) beneath base path '/actuator'
2023-10-30T09:31:26.497Z  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2023-10-30T09:31:26.499Z  INFO 1 --- [           main] o.s.m.s.b.SimpleBrokerMessageHandler     : Starting...
2023-10-30T09:31:26.527Z  INFO 1 --- [           main] o.s.m.s.b.SimpleBrokerMessageHandler     : BrokerAvailabilityEvent[available=true, SimpleBrokerMessageHandler [org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry@62b969c4]]
2023-10-30T09:31:26.529Z  INFO 1 --- [           main] o.s.m.s.b.SimpleBrokerMessageHandler     : Started.
2023-10-30T09:31:26.588Z  INFO 1 --- [           main] ioviAvibDataProjectionBackendApplication : Started PocUnioviAvibDataProjectionBackendApplication in 14.356 seconds (process running for 15.833)
2023-10-30T09:31:28.965Z  INFO 1 --- [nio-8080-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-10-30T09:31:28.965Z  INFO 1 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2023-10-30T09:31:28.967Z  INFO 1 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Completed initialization in 2 ms
2023-10-30T09:32:24.752Z  INFO 1 --- [MessageBroker-1] o.s.w.s.c.WebSocketMessageBrokerStats    : WebSocketSession[0 current WS(0)-HttpStream(0)-HttpPoll(0), 0 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(0)-CONNECTED(0)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0], outboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0], sockJsScheduler[pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 0]
2023-10-30T10:02:24.826Z  INFO 1 --- [MessageBroker-1] o.s.w.s.c.WebSocketMessageBrokerStats    : WebSocketSession[0 current WS(0)-HttpStream(0)-HttpPoll(0), 1 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(0)-CONNECTED(0)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 3], outboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1], sockJsScheduler[pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 1]
2023-10-30T10:32:24.827Z  INFO 1 --- [MessageBroker-1] o.s.w.s.c.WebSocketMessageBrokerStats    : WebSocketSession[0 current WS(0)-HttpStream(0)-HttpPoll(0), 1 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(0)-CONNECTED(0)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 3], outboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1], sockJsScheduler[pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 2]
2023-10-30T11:02:24.828Z  INFO 1 --- [MessageBroker-1] o.s.w.s.c.WebSocketMessageBrokerStats    : WebSocketSession[0 current WS(0)-HttpStream(0)-HttpPoll(0), 1 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(0)-CONNECTED(0)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 3], outboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1], sockJsScheduler[pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 3]
2023-10-30T11:32:24.829Z  INFO 1 --- [MessageBroker-1] o.s.w.s.c.WebSocketMessageBrokerStats    : WebSocketSession[0 current WS(0)-HttpStream(0)-HttpPoll(0), 1 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(0)-CONNECTED(0)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 3], outboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1], sockJsScheduler[pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 4]
2023-10-30T12:02:24.830Z  INFO 1 --- [MessageBroker-1] o.s.w.s.c.WebSocketMessageBrokerStats    : WebSocketSession[0 current WS(0)-HttpStream(0)-HttpPoll(0), 1 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(0)-CONNECTED(0)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 3], outboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1], sockJsScheduler[pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 5]
2023-10-30T12:32:24.834Z  INFO 1 --- [MessageBroker-1] o.s.w.s.c.WebSocketMessageBrokerStats    : WebSocketSession[0 current WS(0)-HttpStream(0)-HttpPoll(0), 1 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(0)-CONNECTED(0)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 3], outboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1], sockJsScheduler[pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 6]
2023-10-30T13:02:24.834Z  INFO 1 --- [MessageBroker-1] o.s.w.s.c.WebSocketMessageBrokerStats    : WebSocketSession[0 current WS(0)-HttpStream(0)-HttpPoll(0), 5 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(4)-CONNECTED(4)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 39], outboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 9], sockJsScheduler[pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 7]

How Can I obtain more errors details (follow your sample) to know exactly what happend using the kubernetes ingress controller?.