Skip to content

Commit

Permalink
Changes from PR review
Browse files Browse the repository at this point in the history
Signed-off-by:Phillip Kruger <[email protected]>
  • Loading branch information
phillip-kruger committed Jun 8, 2020
1 parent 42e640f commit dcb0599
Show file tree
Hide file tree
Showing 47 changed files with 234 additions and 142 deletions.
28 changes: 22 additions & 6 deletions message-ranges.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,27 @@
17800-17899 = logging

# Kafka (smallrye-reactive-messaging-kafka)
18000-18333 = exceptions
18334-18666 = messaging
18667-18999 = logging
18000-18099 = exceptions
18100-18199 = messaging
18200-18299 = logging

# In Memory (smallrye-reactive-messaging-in-memory)
19000-19333 = exceptions
19334-19666 = messaging
19667-19999 = logging
18300-18399 = exceptions
18400-18499 = messaging
18500-18599 = logging

18600-18699
18700-18799
18800-18899

19000-19099
19100-19199
19200-19299

19300-19399
19400-19499
19500-19599

19600-19699
19700-19799
19800-19899
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;

/**
* Exceptions for AMQP Connector
* Assigned ID range is 16000-16099
*/
@MessageBundle(projectCode = "SRMSG")
public interface AMQPExceptions {

AMQPExceptions ex = Messages.getBundle(AMQPExceptions.class);

// 16000-16099 (exceptions)

@Message(id = 16000, value = "Cannot find a %s bean named %s")
IllegalStateException illegalStateFindingBean(String className, String beanName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;

/**
* Logging for AMQP Connector
* Assigned ID range is 16200-16299
*/
@MessageLogger(projectCode = "SRMSG")
public interface AMQPLogging {

// 16200-16299 (logging)

AMQPLogging log = Logger.getMessageLogger(AMQPLogging.class, "io.smallrye.reactive.messaging.amqp");

@LogMessage(level = Logger.Level.DEBUG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;

/**
* Messages for AMQP Connector
* Assigned ID range is 16100-16199
*/
@MessageBundle(projectCode = "SRMSG")
public interface AMQPMessages {

AMQPMessages msg = Messages.getBundle(AMQPMessages.class);

// 16100-16199 (String messages)

@Message(id = 16100, value = "Invoker not initialized")
String invokerNotInitialized();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;

/**
* Exceptions for AWS SNS Connector
* Assigned ID range is 15000-15099
*/
@MessageBundle(projectCode = "SRMSG")
public interface SnsExceptions {

SnsExceptions ex = Messages.getBundle(SnsExceptions.class);

// 15000-15099 (exceptions)

@Message(id = 15000, value = "Invalid URL")
IllegalArgumentException illegalArgumentInvalidURL(@Cause Throwable t);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;

/**
* Exceptions for AWS SNS Connector
* Assigned ID range is 15200-15299
*/
@MessageLogger(projectCode = "SRMSG")
public interface SnsLogging {

// 15200-15299 (logging)

SnsLogging log = Logger.getMessageLogger(SnsLogging.class, "io.smallrye.reactive.messaging.aws.sns");

@LogMessage(level = Logger.Level.INFO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;

/**
* Messages for AWS SNS Connector
* Assigned ID range is 15100-15199
*/
@MessageBundle(projectCode = "SRMSG")
public interface SnsMessages {

SnsMessages msg = Messages.getBundle(SnsMessages.class);

// 15100-15199 (String messages)

@Message(id = 15100, value = "Host cannot be null")
String hostNotNull();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

import io.smallrye.reactive.messaging.camel.CamelFailureHandler;

/**
* Exceptions for Camel Connector
* Assigned ID range is 17600-17699
*/
@MessageBundle(projectCode = "SRMSG")
public interface CamelExceptions {

CamelExceptions ex = Messages.getBundle(CamelExceptions.class);

// 17600-17699 (exceptions)

@Message(id = 17600, value = "Unknown failure strategy: %s")
IllegalArgumentException illegalArgumentUnknownStrategy(CamelFailureHandler.Strategy strategy);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;

/**
* Logging for Camel Connector
* Assigned ID range is 17800-17899
*/
@MessageLogger(projectCode = "SRMSG")
public interface CamelLogging {

// 17800-17899 (logging)

CamelLogging log = Logger.getMessageLogger(CamelLogging.class, "io.smallrye.reactive.messaging.camel");

@LogMessage(level = Logger.Level.INFO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.MessageBundle;

/**
* Messages for Camel Connector
* Assigned ID range is 17700-17799
*/
@MessageBundle(projectCode = "SRMSG")
public interface CamelMessages {

CamelMessages msg = Messages.getBundle(CamelMessages.class);

// 17700-17799 (messaging)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;

/**
* Exceptions for Cloud event Connector
* Assigned ID range is 15300-15399
*/
@MessageBundle(projectCode = "SRMSG")
public interface CloudEventExceptions {

CloudEventExceptions ex = Messages.getBundle(CloudEventExceptions.class);

// 15300-15399 (exceptions)

@Message(id = 15300, value = "Invalid message - no payload")
IllegalArgumentException illegalArgumentInvalidMessage();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;

/**
* Logging for Cloud event Connector
* Assigned ID range is 15500-15599
*/
@MessageLogger(projectCode = "SRMSG")
public interface CloudEventLogging {

// 15500-15599 (logging)

CloudEventLogging log = Logger.getMessageLogger(CloudEventLogging.class, "io.smallrye.reactive.messaging.cloudevents");

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.MessageBundle;

/**
* Messages for Cloud event Connector
* Assigned ID range is 15400-15499
*/
@MessageBundle(projectCode = "SRMSG")
public interface CloudEventMessages {

CloudEventMessages msg = Messages.getBundle(CloudEventMessages.class);

// 15400-15499 (String messages)

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;

/**
* Exceptions for GCP Pub/Sub Connector
* Assigned ID range is 14600-14699
*/
@MessageBundle(projectCode = "SRMSG")
public interface PubSubExceptions {

PubSubExceptions ex = Messages.getBundle(PubSubExceptions.class);

// 14600-14699 (exceptions)

@Message(id = 14600, value = "Unable to build pub/sub subscription admin client")
IllegalStateException illegalStateUnableToBuildSubscriptionAdminClient(@Cause Throwable t);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
import com.google.pubsub.v1.ProjectTopicName;
import com.google.pubsub.v1.PubsubMessage;

/**
* Logging for GCP Pub/Sub Connector
* Assigned ID range is 14800-14899
*/
@MessageLogger(projectCode = "SRMSG")
public interface PubSubLogging {

// 14800-14899 (logging)

PubSubLogging log = Logger.getMessageLogger(PubSubLogging.class, "io.smallrye.reactive.messaging.gcp.pubsub");

@LogMessage(level = Logger.Level.TRACE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;

/**
* Messages for GCP Pub/Sub Connector
* Assigned ID range is 14700-14799
*/
@MessageBundle(projectCode = "SRMSG")
public interface PubSubMessages {

PubSubMessages msg = Messages.getBundle(PubSubMessages.class);

// 14700-14799 (String messages)

@Message(id = 14700, value = "%s must be non-null")
String mustNotBeNull(String fieldName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;

/**
* Exceptions for HTTP Connector
* Assigned ID range is 16300-16399
*/
@MessageBundle(projectCode = "SRMSG")
public interface HttpExceptions {

HttpExceptions ex = Messages.getBundle(HttpExceptions.class);

// 16300-16399 (exceptions)

@Message(id = 16300, value = "The `url` must be set")
IllegalArgumentException illegalArgumentUrlNotSet();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;

/**
* Logging for HTTP Connector
* Assigned ID range is 16500-16599
*/
@MessageLogger(projectCode = "SRMSG")
public interface HttpLogging {

// 16500-16599 (logging)

HttpLogging log = Logger.getMessageLogger(HttpLogging.class, "io.smallrye.reactive.messaging.http");

@LogMessage(level = Logger.Level.DEBUG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;

/**
* Messages for HTTP Connector
* Assigned ID range is 16400-16499
*/
@MessageBundle(projectCode = "SRMSG")
public interface HttpMessages {

HttpMessages msg = Messages.getBundle(HttpMessages.class);

// 16400-16499 (String messages)

@Message(id = 16400, value = "Payload must not be null")
String payloadMustNotBeNull();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,14 @@ public static void clear() {
@Override
public PublisherBuilder<? extends Message<?>> getPublisherBuilder(Config config) {
String name = config.getOptionalValue("channel-name", String.class)
.orElseThrow(
() -> ex.illegalArgumentInvalidIncomingConfig());
.orElseThrow(ex::illegalArgumentInvalidIncomingConfig);
return sources.computeIfAbsent(name, InMemorySourceImpl::new).source;
}

@Override
public SubscriberBuilder<? extends Message<?>, Void> getSubscriberBuilder(Config config) {
String name = config.getOptionalValue("channel-name", String.class)
.orElseThrow(
() -> ex.illegalArgumentInvalidOutgoingConfig());
.orElseThrow(ex::illegalArgumentInvalidOutgoingConfig);
return sinks.computeIfAbsent(name, InMemorySinkImpl::new).sink;
}

Expand Down
Loading

0 comments on commit dcb0599

Please sign in to comment.