Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use binary protocol lookup for connection between WebSocket proxy and broker #363

Merged
merged 1 commit into from
Apr 19, 2017

Conversation

yush1ga
Copy link
Contributor

@yush1ga yush1ga commented Apr 18, 2017

Motivation

WebSocket proxy uses http lookup and it causes the problems like following.

  • Connection of WebSocket client is along the following process.
    1. When handshake between WebSocket client and proxy is started, a thread for http is used.
    2. onWebSocketConnect() in AbstractWebSocketHandler is called when the handshake is finished.
    3. Then, a consumer or a producer uses http lookup.
    4. After lookup is finished, onWebSocketConnect() is finished and the thread is released.
  • In the case that WebSocket proxy and broker are in the same server,
    http queue defined here is blocked when many clients connect to WebSocket proxy simultaneously.
    The reason is that onWebSocketConnect functions exhaust threads and http lookup in queue is not started and finished.
    Therefore, onWebSocketConnect functions are not finished either.

Modifications

Use binary protocol lookup for connection between WebSocket proxy and broker.

Result

The problem is fixed.

@merlimat merlimat added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Apr 18, 2017
@merlimat merlimat added this to the 1.18 milestone Apr 18, 2017
Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@saandrews saandrews merged commit 3b99f30 into apache:master Apr 19, 2017
hrsakai pushed a commit to hrsakai/pulsar that referenced this pull request Dec 10, 2020
Fixes apache#342

### Motivation

Add support for KeySharedPolicy with AutoSplit or Sticky mode for consumer, which is a useful for some user cases like scalable request-reply pattern.

### Modifications

add key shared policy options for consumer, and a helpful constructor for validating hash range list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants