Quick Links: |
Provide a value-semantic type to configure session with the broker. More...
Namespaces | |
namespace | bmqpi |
namespace | bmqt |
bmqt::SessionOptions
provides a value-semantic type, SessionOptions
, which is used to specify session-level configuration parameters. Session
; the default parameters are fine. tcp://<host>:port
. Host can be: o an explicit hostname or localhost
o an ip, example 10.11.12.13 o a DNS entry. In this case, the client will resolve the list of addresses from that entry, and try to connect to one of them. When the connection with the host goes down, it will automatically immediately failover and reconnects to another entry from the address list. If the environment variable BMQ_BROKER_URI
is set, then instances of bmqa::Session
will ignore the brokerUri
field from the provided SessionOptions
and use the value from this environment variable instead. SessionEventHandler
to the session. writeCacheHiWatermark
of the btemt_ChannelPoolConfiguration
object used by the session with the broker. Note that BlazingMQ reserves 4MB of this value for control message, so the actual watermark for data published is channelHighWatermark - 4MB
. bmqt::SessionEventType::e_SLOWCONSUMER_HIGHWATERMARK
) is emitted when the buffer reaches the highWatermark
value, and a notification (bmqt::SessionEventType::e_SLOWCONSUMER_NORMAL
) is sent when the buffer is back to the lowWatermark
. The highWatermark
typically would be reached in case of either a very slow consumer, causing events to accumulate in the buffer, or a huge burst of data. Setting the highWatermark
to a high value should be done cautiously because it will potentially hide slowness of the consumer because of the enqueuing of PUSH events for a consumer, ACK events for a producer as well as all system events to the buffer (meaning that the messages may have a huge latency). Note, it is also recommended to have a reasonable distance between highWatermark
and lowWatermark
values to avoid a constant back and forth toggling of state resulting from push pop of events. bmqpi::HostHealthMonitor
, responsible for notifying the Session
when the health of the host machine has changed. A hostHealthMonitor
must be specified, in order for queues opened through the session to suspend on unhealthy hosts.