Skip to content

Cannot create producer via websocket in standalone mode #6079

@VitalyShein

Description

@VitalyShein

Describe the bug
Websocket api is broken - it is impossible to connect with producer to any existing topic.

To Reproduce
Steps to reproduce the behavior:

  1. Run pulsar in standalone mode (docker-compose file):
services:
  standalone:
    image: apachepulsar/pulsar-standalone:2.5.0
    expose:
      - 8080
      - 6650
    ports:
      - "6650:6650"
      - "8080:8080"
  1. Try to create producer via websocket (python 3.7)
import asyncio
import websockets

async def connect_test():
    TOPIC = 'ws://localhost:8080/ws/v2/producer/persistent/public/default/my-topic'
    async with websockets.connect(TOPIC) as websocket:
        print('connected!')

asyncio.get_event_loop().run_until_complete(connect_test())
  1. An exception will occur: error 400
  2. Pulsar logs in docker:
12:46:38.002 [pulsar-web-57-6] WARN  org.apache.pulsar.websocket.ProducerHandler - [172.18.0.1:48562] Failed in creating producer on topic persistent://public/default/my-topic: Param serviceUrl must not be blank.
12:46:38.002 [pulsar-web-57-6] INFO  org.eclipse.jetty.server.RequestLog - 172.18.0.1 - - [17/Jan/2020:12:46:38 +0000] "GET /ws/v2/producer/persistent/public/default/my-topic HTTP/1.1" 400 462 "-" "Python/3.7 websockets/8.1" 1
  1. Change version of pulsar to 2.4.2 - all is working fine!

Desktop (please complete the following information):

  • OS: Windows 10
  • Docker-engine: 19.0.3.5

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions