aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] cschneider closed pull request #8: Do not return a Postition from send signature in the API
Date Thu, 03 Jan 2019 14:50:28 GMT
cschneider closed pull request #8: Do not return a Postition from send signature in the API
URL: https://github.com/apache/aries-journaled-events/pull/8
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/Messaging.java
b/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/Messaging.java
index 36433d9..2cd1138 100644
--- a/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/Messaging.java
+++ b/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/Messaging.java
@@ -28,7 +28,7 @@
      * Send a message to a topic. When this method returns the message 
      * is safely persisted.
      */
-    Position send(String topic, Message message);
+    void send(String topic, Message message);
 
     /**
      * Subscribe to a topic. The callback is called for each message received.
diff --git a/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/InMemoryMessaging.java
b/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/InMemoryMessaging.java
index e2639fe..8966c16 100644
--- a/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/InMemoryMessaging.java
+++ b/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/InMemoryMessaging.java
@@ -36,9 +36,9 @@
     private Map<String, Topic> topics = new ConcurrentHashMap<>();
 
     @Override
-    public Position send(String topicName, Message message) {
+    public void send(String topicName, Message message) {
         Topic topic = getOrCreate(topicName);
-        return topic.send(message);
+        topic.send(message);
     }
 
     @Override
diff --git a/org.apache.aries.events.memory/src/test/java/org/apache/aries/events/memory/MessagingTest.java
b/org.apache.aries.events.memory/src/test/java/org/apache/aries/events/memory/MessagingTest.java
index a8262bd..2a70b6e 100644
--- a/org.apache.aries.events.memory/src/test/java/org/apache/aries/events/memory/MessagingTest.java
+++ b/org.apache.aries.events.memory/src/test/java/org/apache/aries/events/memory/MessagingTest.java
@@ -62,9 +62,7 @@ public void testPositionFromString() {
     public void testSend() {
         subscriptions.add(messaging.subscribe("test", null, Seek.earliest, callback));
         String content = "testcontent";
-        Position pos = send("test", content);
-        assertThat(pos.toString(), equalTo("0"));
-        
+        send("test", content);
         verify(callback, timeout(1000)).accept(messageCaptor.capture());
         Received received = messageCaptor.getValue();
         assertThat(received.getMessage().getPayload(), equalTo(toBytes(content)));
@@ -132,11 +130,11 @@ private String getContent(Received rec) {
         return new String(rec.getMessage().getPayload(), Charset.forName("UTF-8"));
     }
     
-    private Position send(String topic, String content) {
+    private void send(String topic, String content) {
         Map<String, String> props = new HashMap<String, String>();
         props.put("my", "testvalue");
         Message message = messaging.newMessage(toBytes(content), props);
-        return messaging.send(topic, message);
+        messaging.send(topic, message);
     }
 
     private byte[] toBytes(String content) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message