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

PulsarApplication.newInstance doesn't throw if connecting to Pulsar fails w multipleTopicsPattern #79

Open
paasovaara opened this issue Apr 29, 2019 · 0 comments

Comments

@paasovaara
Copy link

PulsarApplication.newInstance should abort and close if we cannot connect to Pulsar. This will happen if we have single topic but if multipleTopics=true, the app will just stay in the loop.

Steps to reproduce:

  1. shut down Pulsar
  2. environment.conf:
include "common.conf"

pulsar {
  consumer {
    #topic="omm-service-alert"
    multipleTopics=true
    multipleTopics=${?PULSAR_CONSUMER_ENABLE_MULTIPLE_TOPICS}
    topicsPattern="persistent://public/default/(omm-service-alert|omm-cancellations)"
    topicsPattern=${?PULSAR_CONSUMER_MULTIPLE_TOPICS_PATTERN}
    subscription="transitlog-event-source-sub"
    subscription=${?PULSAR_CONSUMER_SUBSCRIPTION}
  }
  producer {
    enabled = false
  }
}

output:

{"timestamp":"2019-04-29T06:58:47.352Z","level":"INFO","thread":"main","logger":"fi.hsl.common.pulsar.PulsarApplication","message":"Creating Pulsar consumer for multiple topics using pattern: persistent://public/default/(omm-service-alert|omm-cancellations)","context":"default"}
{"timestamp":"2019-04-29T06:58:47.556Z","level":"WARN","thread":"pulsar-client-io-1-1","logger":"org.apache.pulsar.client.impl.ConnectionPool","message":"Failed to open connection to localhost:6650 : org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:6650","context":"default"}
{"timestamp":"2019-04-29T06:58:47.660Z","level":"WARN","thread":"pulsar-external-listener-3-1","logger":"org.apache.pulsar.client.impl.BinaryProtoLookupService","message":"[namespace: public/default] Could not get connection while getTopicsUnderNamespace -- Will try again in 100 ms","context":"default"}
@paasovaara paasovaara changed the title PulsarApplication.newInstance doesn't throw if connecting to Pulsar w multipleTopicsPattern fails PulsarApplication.newInstance doesn't throw if connecting to Pulsar fails w multipleTopicsPattern Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant