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

add pulsar as a broker #792

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

add pulsar as a broker #792

wants to merge 1 commit into from

Conversation

paulm17
Copy link

@paulm17 paulm17 commented Mar 27, 2024

Proposed changes

This update adds pulsar as a broker.

Docker.yml: https://pastebin.com/raw/nr85SxdS
Instructions: https://pastebin.com/raw/Swwk9LcR

Run 3 centrifugo instances:

West:

  "port": 8000,
  "broker": "pulsar",
  "pulsar_url": "pulsar://127.0.0.1:6650",
  "pulsar_tenant": "my-tenant",
  "pulsar_namespace": "my-namespace",

Cent:

  "port": 8001,
  "pulsar_url": "pulsar://127.0.0.1:6651",

East:

  "port": 8002,
  "pulsar_url": "pulsar://127.0.0.1:6652",

Run 3 instances of the app:

git clone https://github.com/paulm17/centrifugo_app centrifugo_west
git clone https://github.com/paulm17/centrifugo_app centrifugo_cent
git clone https://github.com/paulm17/centrifugo_app centrifugo_east

Update

Cent:

NEXT_PUBLIC_URL=http://localhost:3001
NEXT_PUBLIC_CENTRIFUGE_URL=http://localhost:8001
NEXT_PUBLIC_CENTRIFUGE_WEBSOCKET_URL='localhost:8001'

East:

NEXT_PUBLIC_URL=http://localhost:3002
NEXT_PUBLIC_CENTRIFUGE_URL=http://localhost:8002
NEXT_PUBLIC_CENTRIFUGE_WEBSOCKET_URL='localhost:8002'

Change APIKEY + APISECRET for all 3 apps.

Ensure all 3 apps have their Ids unique:
West = A
Cent = B
East = C

/src/app/components/sendMessage.tsx

const serverId = "1234"
const userId = "A-1234"

To test:

Launch all 3 app instances, should run on each individual port. Click hitme button and should see all 3 instances with the same message. Test each instance and you should see the message coming from A, B or C.

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.

1 participant