aboutsummaryrefslogtreecommitdiffstats
path: root/messagebus/src/vespa/messagebus/messagebusparams.cpp
blob: 8a38b07c9a8a075d4d2143c420d3732ff46a5069 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "messagebus.h"
#include <vespa/messagebus/routing/retrytransienterrorspolicy.h>
#include <vespa/vespalib/util/size_literals.h>

namespace mbus {

MessageBusParams::MessageBusParams() :
    _protocols(),
    _retryPolicy(new RetryTransientErrorsPolicy()),
    _maxPendingCount(1024),
    _maxPendingSize(128_Mi)
{ }

MessageBusParams::~MessageBusParams() {}

uint32_t
MessageBusParams::getNumProtocols() const
{
    return _protocols.size();
}

IProtocol::SP
MessageBusParams::getProtocol(uint32_t i) const
{
    return _protocols[i];
}

MessageBusParams &
MessageBusParams::addProtocol(IProtocol::SP protocol)
{
    _protocols.push_back(protocol);
    return *this;
}

} // namespace mbus