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

Only first message is sent to rabbit #63

Open
argestes opened this issue May 1, 2017 · 2 comments
Open

Only first message is sent to rabbit #63

argestes opened this issue May 1, 2017 · 2 comments
Labels

Comments

@argestes
Copy link

argestes commented May 1, 2017

  val lolExchange = Exchange("book.lol.lol", Direct, durable = true)
  val lolSubscriber: Subscriber[Message] = connection.publish(lolExchange.name, "")

class MessageBroadcasterActor(sub : Subscriber[Message]) extends Actor {

    import com.google.common.net.MediaType

    implicit def toMsg(rl : RelatedProduct) : Message = {
      new Message(
      body        = rl.productId.toString.getBytes(StandardCharsets.UTF_8),
      contentType = Some(MediaType.PLAIN_TEXT_UTF_8),
      mode = Persistent
      )
   }

   override def receive: Receive = {
     case x : RelatedProduct => {
     sub.onNext(toMsg(x))
     }
   }
 }

I'm using the code above but I can only see the first message on rabbit. Am I doing something wrong or is it a bug?

@mkiedys
Copy link
Contributor

mkiedys commented May 4, 2017

What is sub?

@argestes
Copy link
Author

argestes commented May 7, 2017

It's a message exchange
val lolSubscriber: Subscriber[Message] = connection.publish(lolExchange.name, "")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants