Package io.jstach.rainbowgum.rabbitmq
Class RabbitMQOutputBuilder
java.lang.Object
io.jstach.rainbowgum.rabbitmq.RabbitMQOutputBuilder
- All Implemented Interfaces:
LogBuilder<RabbitMQOutputBuilder,RabbitMQOutput>
public final class RabbitMQOutputBuilder
extends Object
implements LogBuilder<RabbitMQOutputBuilder,RabbitMQOutput>
Builder to create
RabbitMQOutput.
Creates a RabbitMQOutput.
| Property Pattern | Type | Required | Default | Description |
|---|---|---|---|---|
"logging.output.{name}.uri" |
URI |
false |
null |
Passed to the rabbitmq connection factory. |
"logging.output.{name}.exchange" |
String |
true |
"logging" | Exchange to send messages to. |
"logging.output.{name}.routingKey" |
String (converted) |
false |
null |
The logging event level will be used by default. |
"logging.output.{name}.declareExchange" |
Boolean |
false |
null |
Declare exchange on start. Default is false. |
"logging.output.{name}.host" |
String |
false |
null |
Host. |
"logging.output.{name}.username" |
String |
false |
null |
Set user name if not null outside of URI. |
"logging.output.{name}.password" |
String |
false |
null |
Set password if not null outside of URI. |
"logging.output.{name}.port" |
Integer |
false |
null |
Set port if not null. |
"logging.output.{name}.appId" |
String |
false |
null |
Sets the message appId if not null. |
"logging.output.{name}.connectionName" |
String |
false |
null |
Connection name if not null. |
"logging.output.{name}.exchangeType" |
String |
false |
"topic" | Exchange type like "topic" covered in rabbitmq doc. |
"logging.output.{name}.virtualHost" |
String |
false |
null |
Sets virtualhost if not null. |
-
Constructor Summary
ConstructorsConstructorDescriptionRabbitMQOutputBuilder(String name) Create a builder forio.jstach.rainbowgum.rabbitmq.RabbitMQOutput. -
Method Summary
Modifier and TypeMethodDescriptionSets appId.build()Createsio.jstach.rainbowgum.rabbitmq.RabbitMQOutputfrom this builder.connectionName(@Nullable String connectionName) Sets connectionName.declareExchange(@Nullable Boolean declareExchange) Sets declareExchange.Sets required exchange.exchangeType(@Nullable String exchangeType) Sets exchangeType.fromProperties(LogProperties properties) Will try to convert string key values to parameters needed by the builder.Sets host.Sets password.Sets port.The interpolated property prefix: "logging.output.{name}.".routingKey(@Nullable Function<LogEvent, String> routingKey) Sets routingKey.voidtoProperties(BiConsumer<String, String> consumer) Turns the builder into java.util.Properties like Map skipping values that are null.Sets uri.Sets username.virtualHost(@Nullable String virtualHost) Sets virtualHost.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jstach.rainbowgum.LogBuilder
fromProperties
-
Constructor Details
-
RabbitMQOutputBuilder
Create a builder forio.jstach.rainbowgum.rabbitmq.RabbitMQOutput.- Parameters:
name- will fill{name}inlogging.output.{name}.. Used to resolve config and give the output a name.
-
-
Method Details
-
uri
Sets uri. Passed to the rabbitmq connection factory. Default isnull.- Parameters:
uri-"logging.output.{name}.uri" = java.net.URIPassed to the rabbitmq connection factory.- Returns:
- this builder.
-
exchange
Sets required exchange. Exchange to send messages to. Default is "logging".- Parameters:
exchange-"logging.output.{name}.exchange" = java.lang.StringExchange to send messages to.- Returns:
- this builder.
-
routingKey
Sets routingKey. The logging event level will be used by default. Default isnull.- Parameters:
routingKey-"logging.output.{name}.routingKey" = java.util.function.FunctionThe logging event level will be used by default.- Returns:
- this builder.
-
declareExchange
Sets declareExchange. Declare exchange on start. Default is false. Default isnull.- Parameters:
declareExchange-"logging.output.{name}.declareExchange" = java.lang.BooleanDeclare exchange on start. Default is false.- Returns:
- this builder.
-
host
Sets host. Host. Default isnull.- Parameters:
host-"logging.output.{name}.host" = java.lang.StringHost.- Returns:
- this builder.
-
username
Sets username. Set user name if not null outside of URI. Default isnull.- Parameters:
username-"logging.output.{name}.username" = java.lang.StringSet user name if not null outside of URI.- Returns:
- this builder.
-
password
Sets password. Set password if not null outside of URI. Default isnull.- Parameters:
password-"logging.output.{name}.password" = java.lang.StringSet password if not null outside of URI.- Returns:
- this builder.
-
port
Sets port. Set port if not null. Default isnull.- Parameters:
port-"logging.output.{name}.port" = java.lang.IntegerSet port if not null.- Returns:
- this builder.
-
appId
Sets appId. Sets the message appId if not null. Default isnull.- Parameters:
appId-"logging.output.{name}.appId" = java.lang.StringSets the message appId if not null.- Returns:
- this builder.
-
connectionName
Sets connectionName. Connection name if not null. Default isnull.- Parameters:
connectionName-"logging.output.{name}.connectionName" = java.lang.StringConnection name if not null.- Returns:
- this builder.
-
exchangeType
Sets exchangeType. Exchange type like "topic" covered in rabbitmq doc. Default is "topic".- Parameters:
exchangeType-"logging.output.{name}.exchangeType" = java.lang.StringExchange type like "topic" covered in rabbitmq doc.- Returns:
- this builder.
-
virtualHost
Sets virtualHost. Sets virtualhost if not null. Default isnull.- Parameters:
virtualHost-"logging.output.{name}.virtualHost" = java.lang.StringSets virtualhost if not null.- Returns:
- this builder.
-
build
Createsio.jstach.rainbowgum.rabbitmq.RabbitMQOutputfrom this builder.- Returns:
io.jstach.rainbowgum.rabbitmq.RabbitMQOutput.
-
fromProperties
Description copied from interface:LogBuilderWill try to convert string key values to parameters needed by the builder.- Specified by:
fromPropertiesin interfaceLogBuilder<RabbitMQOutputBuilder,RabbitMQOutput> - Parameters:
properties- log properties- Returns:
- this.
-
toProperties
Turns the builder into java.util.Properties like Map skipping values that are null.- Parameters:
consumer- apply is called where first arg is key and second is value.
-
propertyPrefix
The interpolated property prefix: "logging.output.{name}.".- Specified by:
propertyPrefixin interfaceLogBuilder<RabbitMQOutputBuilder,RabbitMQOutput> - Returns:
- resolved prefix which should end with a "
.". - See Also:
-