GithubHelp home page GithubHelp logo

Comments (5)

wrobell avatar wrobell commented on August 25, 2024

BTW. When running publisher example using rstream from git repo:

Traceback (most recent call last):
  File "/home/wrobell/projects/snippets/rabbitmq/producer.py", line 15, in <module>
    asyncio.run(publish())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/wrobell/projects/snippets/rabbitmq/producer.py", line 13, in publish
    await producer.publish('mystream', f'msg: {i}'.encode())
  File "/home/wrobell/.local/lib/python3.9/site-packages/rstream/producer.py", line 199, in publish
    publishing_ids = await self.publish_batch(
  File "/home/wrobell/.local/lib/python3.9/site-packages/rstream/producer.py", line 165, in publish_batch
    msg = RawMessage(item) if isinstance(item, bytes) else item
TypeError: RawMessage() takes no arguments

from rstream.

Gsantomaggio avatar Gsantomaggio commented on August 25, 2024

the stream must exist.

if you try the java client you will have the same result:

  Consumer consumer =
                environment.consumerBuilder()
                        .stream("stream_that_is_not_created_before")
                        .offset(OffsetSpecification.offset(100))
                        .messageHandler((context, message) -> {

error:

Exception in thread "main" com.rabbitmq.stream.StreamDoesNotExistException: Stream stream_that_is_not_created_before  does not exist
	at com.rabbitmq.stream.impl.ConsumersCoordinator.findBrokersForStream(ConsumersCoordinator.java:134)
	at com.rabbitmq.stream.impl.ConsumersCoordinator.subscribe(ConsumersCoordinator.java:88)
	at com.rabbitmq.stream.impl.StreamEnvironment.registerConsumer(StreamEnvironment.java:471)
	at com.rabbitmq.stream.impl.StreamConsumer.<init>(StreamConsumer.java:91)
	at com.rabbitmq.stream.impl.StreamConsumerBuilder.build(StreamConsumerBuilder.java:113)
	at Main.main(Main.java:82)

from rstream.

wrobell avatar wrobell commented on August 25, 2024

Thanks for the example. There is stream creator concept though. This seems to allow to create streams by both producers and consumers?

from rstream.

Gsantomaggio avatar Gsantomaggio commented on August 25, 2024

the streamCreator() is an environment method, so nothing to do with publishers and consumers.

from rstream.

wrobell avatar wrobell commented on August 25, 2024

OK. I do understand the distinction your are point at. Let's close this issue then.

from rstream.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.