0

Using Alpakka, we can create a non-durable subscriber for any topic using the below code:

Source<String, NotUsed> jmsTopicSource = JmsSource
    .textSource(JmsSourceSettings
        .create(connectionFactory)
        .withTopic("topic")
        .withBufferSize(10)
    );

Does anyone have an idea how to make this topic subscriber durable?

Jeffrey Chung
  • 19,319
  • 8
  • 34
  • 54
NiranjanK
  • 427
  • 2
  • 6
  • 23

1 Answers1

1

I don't think the creation of durable consumers is supported in Alpakka's JMS connector, as of version 0.9. In the internal API, JmsConnector is calling Session#createConsumer:

private[jms] def createConsumer()(implicit ec: ExecutionContext): Future[jms.MessageConsumer] =
  Future {
    session.createConsumer(destination)
  }

There doesn't appear to be a way to invoke any of the methods (e.g., Session#createDurableConsumer) that the JMS Session object provides to create durable consumers.

Jeffrey Chung
  • 19,319
  • 8
  • 34
  • 54
  • ok .that's helpful but is it possible to extend an alpakka API or change its configuration to make it durable ? – NiranjanK Jun 16 '17 at 03:01
  • can we extend the GraphStage< SourceShape< Message > > and then override the method which creates an consumer ?? @chunjef – NiranjanK Jun 20 '17 at 05:59