Skip to content

Conversation

@jbertram
Copy link
Contributor

I'm removing all the HTTP-specific idle connection functionality for 2 reasons:

  • the client-side keep-alive mechanism is completely broken
  • this duplicates the pinging functionality already in the Core protocol

When the client-side sends an HTTP request for keep-alive purposes, it sends a GET. The broker only handles POST requests and therefore throws a ClassCastException causing the connection to fail. This appears to have been broken for a long time.

Furthermore, both the client-side and broker-side HTTP-specific keep-alive code appears to be completely unnecessary. When httpEnabled=true the Core client simply tunnels it's normal packets through HTTP requests, including the normal ping packets to & from the broker. There is no need to have another keep-alive mechanism assuming the client configures their clientFailureCheckPeriod and connectionTTL appropriately. I can only assume this code was added for a defunct use-case.

I'm removing all the HTTP-specific idle connection functionality for 2
reasons:

 - the client-side keep-alive mechanism is completely broken
 - this duplicates the pinging functionality already in the Core
   protocol

When the client-side sends an HTTP request for keep-alive purposes, it
sends a GET. The broker only handles POST requests and therefore throws
a ClassCastException causing the connection to fail. This appears to
have been broken for a long time.

Furthermore, both the client-side and broker-side HTTP-specific
keep-alive code appears to be completely unnecessary. When
httpEnabled=true the Core client simply tunnels it's normal packets
through HTTP requests, including the normal ping packets to & from the
broker. There is no need to have another keep-alive mechanism assuming
the client configures their clientFailureCheckPeriod and connectionTTL
appropriately. I can only assume this code was added for a defunct
use-case.
@jbertram
Copy link
Contributor Author

The full test-suite looks good on this.

@tabish121
Copy link
Contributor

This seems reasonable in terms of what was changed, can't speak to why it was there in the first place if protocol keep alive packets could cross without issue.

@jbertram
Copy link
Contributor Author

jbertram commented Dec 19, 2025

@clebertsuconic, @andytaylor this code has been in place since before the donation. Either of you have any idea why it was there? It seems completely superfluous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants