Class OnapMsgRouterPublisher
- java.lang.Object
-
- io.continual.onap.services.publisher.OnapMsgRouterPublisher
-
public class OnapMsgRouterPublisher extends Object
A simple message router publisher. This class issues HTTP transactions that execute in the foreground to push messages to the ONAP Message Router service. This class is intended to be used concurrently.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOnapMsgRouterPublisher.BuilderA builder for the publisher.static classOnapMsgRouterPublisher.MessageA message includes an event stream name and a payload
-
Field Summary
Fields Modifier and Type Field Description static StringkPreferredDateFormat
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OnapMsgRouterPublisher.Builderbuilder()Get a new builderstatic OnapMsgRouterPublisher.BuilderlocalTest()Get a local test publisher builder to optionally customize further.OnapMrResponsesend(OnapMsgRouterPublisher.Message msg)Send a single message to the MR cluster.OnapMrResponsesend(List<OnapMsgRouterPublisher.Message> msgList)Send a set of messages to the MR cluster in an all or nothing attempt.StringtoString()
-
-
-
Field Detail
-
kPreferredDateFormat
public static final String kPreferredDateFormat
- See Also:
- Constant Field Values
-
-
Method Detail
-
localTest
public static OnapMsgRouterPublisher.Builder localTest()
Get a local test publisher builder to optionally customize further. By default, the publisher will run against http://localhost:3904, publishing to TEST-TOPIC.- Returns:
- a builder
-
builder
public static OnapMsgRouterPublisher.Builder builder()
Get a new builder- Returns:
- a builder
-
send
public OnapMrResponse send(OnapMsgRouterPublisher.Message msg)
Send a single message to the MR cluster.- Parameters:
msg- the message to post- Returns:
- the HTTP status code from MR
-
send
public OnapMrResponse send(List<OnapMsgRouterPublisher.Message> msgList)
Send a set of messages to the MR cluster in an all or nothing attempt. Each host in the host list will be attempted at most once.- Parameters:
msgList- a list of messages- Returns:
- the HTTP status code from MR
-
-