Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 05 14:17
    jbwheatley commented #737
  • Oct 05 13:08
    jbwheatley opened #738
  • Oct 05 12:48

    jbwheatley on v5.0.1

    (compare)

  • Oct 05 12:37
    simpadjo commented #737
  • Oct 05 11:35
    jbwheatley closed #736
  • Oct 05 11:35

    jbwheatley on master

    Terminate the stream when the s… (compare)

  • Oct 05 11:35
    jbwheatley closed #737
  • Oct 05 11:08
    simpadjo commented #737
  • Oct 05 11:07
    simpadjo synchronize #737
  • Oct 05 10:57
    jbwheatley commented #737
  • Oct 05 10:50
    jbwheatley commented #737
  • Oct 05 10:24

    jbwheatley on master

    Update mima previous artifact (compare)

  • Oct 05 10:21
    simpadjo commented #737
  • Sep 28 01:37
    stale[bot] closed #735
  • Sep 21 01:07
    stale[bot] labeled #735
  • Sep 21 01:07
    stale[bot] commented #735
  • Sep 17 14:58
    simpadjo opened #737
  • Sep 15 11:57
    simpadjo opened #736
  • Jul 30 16:06
    stale[bot] closed #732
  • Jul 13 18:43
    stale[bot] labeled #732
Gavin Bisesi
@Daenyth
yeah wow I think fs2-rabbit is very slow when you have high prefetch values
if I look in my docker rabbit's console I can see "unacked = 131,072" and "ready = 0" but I'm having to use Agitation to set >4second timeouts on every single message in order to not be timing out
I wonder if this is because of the dequeue1
or if it's something I'm doing myself
Gavin Bisesi
@Daenyth
Running a single test case, in 464,085ms according to logback, I dequeued 47 envelopes. That's not right, we definitely go faster in prod. Something I'm doing is being very slow, maybe it's the Agitation?
lemme try throwing in a groupWithin
maybe bounded by internalQueueSize?
Gavin Bisesi
@Daenyth
Thanks for the quick merge btw. Github actions looks neat. Is there any way to have it also show the html-ized test report?
Gabriel Volpe
@gvolpe
No worries, is there such a thing?
Gavin Bisesi
@Daenyth
sort of. There's the standard junit-style xml that you can have scalatest emit, and many things allow you to navigate through it interactively
even pytest in python emits it, so I wouldn't be surprised if GH can read it
Gabriel Volpe
@gvolpe
no idea tbh, we used to have something like that when we had test coverage metrics
I don't find so much value in it, though
Gavin Bisesi
@Daenyth
more useful for coverage than tests, but I've found them useful especially in projects with thousands of tests - grepping sbt output is a bear
looks like nothing out of the box
oh well
Gavin Bisesi
@Daenyth
ok part of it was slow because my docker rabbit was running out of memory, because I wasn't declaring my test queues with TTLs or as AutoDelete
Adriani Furtado
@Adriani277
Hi all, I was looking at the Publishing Algebra and noticed that most return types
are F[A => F[Unit]]. Is it possible to have a SimplePublish that takes a payload as a parameter and simply publishes the message?
Something like
def simplePublish[A](
      payload: A,
      channel: AMQPChannel,
      exchangeName: ExchangeName,
      routingKey: RoutingKey
  )(implicit encoder: MessageEncoder[F, A]): F[Unit] =
FlatMap[F].flatMap(client.createPublisher(exchangeName, routingKey))(_.apply(payload))
Gavin Bisesi
@Daenyth
I mean it won't be broken
I don't recall off hand what effect is being captured in the "create publisher" method
better to reuse it if you can, but wouldn't be broken if you didn't, I think
Adriani Furtado
@Adriani277
Alright I see, I suspected there would be some performance hit by re-creating the publisher
Sebastian Voss
@sebastianvoss

I have an application which creates a publisher and consumer to interact with an AMQP server.

When the app receives an SIGINT it needs to send a logout message and wait for the response before
shutting down. I got some hint from @Daenyth to use Resource.makeCase but I'm failing to see where
to inject this. Maybe you can help me out again.

val resources = for {
  conn    <- R.createConnection
  resChan <- R.createChannel(conn)
  reqChan <- R.createChannel(conn)
} yield (resChan, reqChan)

resources.use {
  case (responseChannel, requestChannel) =>
    for {
      publisher <- createPublisher(R)(requestChannel)
      consumer  <- createConsumer(R)(responseChannel)
      _         <- program(consumer, publisher).compile.drain
    } yield ()
}
Gavin Bisesi
@Daenyth
below reqChan in resources
oh well no..
actually, onFinalize on program should be able to get you done
Sebastian Voss
@sebastianvoss

Thanks @Daenyth , I just tried this:

resources.use {
  case (responseChannel, requestChannel) =>
    for {
      publisher <- createPublisher(R)(requestChannel)
      consumer  <- createConsumer(R)(responseChannel)
      _         <- program(consumer.onFinalize(IO(println("finalize consumer"), publisher)
          .onFinalize(IO(println("finalize program")
          .compile
          .drain
    } yield ()
}

it prints:

finalize consumer
finalize program
Gavin Bisesi
@Daenyth
wait, what type is Consumer there?
not a Resource, is it?
or stream maybe
Sebastian Voss
@sebastianvoss
Stream[IO, AmqpEnvelope[String]]
Gavin Bisesi
@Daenyth
ah right
Sebastian Voss
@sebastianvoss
createConsumer has this signature: def createConsumer(R: RabbitClient[IO])(implicit channel: AMQPChannel): IO[Stream[IO, AmqpEnvelope[String]]]
Gavin Bisesi
@Daenyth
ok then it needs to happen in program
or alternately, you could have it on consumer
because that's inside the scope of publisher
Sebastian Voss
@sebastianvoss
the thing is I need to keep the consumer stream running to wait for the response. When I tried to put it there the consumer stream got closed before the response came in.
Gavin Bisesi
@Daenyth
You need the consumer to come before the publisher then
I see
mm
yeah so like consumer -> producer -> Stream.bracket and in the bracket, do your cleanup logic there
Then the closure of both consumer and producer waits for that
but in general I do recommend you rethink the pattern because you can't prevent or handle a kill -9
So have an idea of what cleanup you do when the process for this code just vanishes
Sebastian Voss
@sebastianvoss
OK cool, let me try this. In case the shutdown is not graceful the client will reconnect and continue where it left off. This is only needed for graceful shutdown/logout.
Sebastian Voss
@sebastianvoss
I set automaticRecovery = false. On connection error I'm seeing WARN com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occured (Exception message: Connection reset). As I have to send some messages to the broker after reconnect I would prefer to let the whole app stop and cleanly restart. Is there a way to do that?
Gabriel Volpe
@gvolpe
@bpholt I set up sbt-ci-release so now the publishing to Sonatype is automated. If you want to try out your changes, you can use this SNAPSHOT version: 0.0.0+1-0af65537-SNAPSHOT. I'll make a release in the next few days when I get some time...
Brian P. Holt
@bpholt
Oh, awesome! I'll give that a shot
Brian P. Holt
@bpholt
is there a specific resolver I need to use to pull that in? I haven't tried using published snapshots before
Brian P. Holt
@bpholt
found it:
resolvers += Resolver.sonatypeRepo("snapshots")