[jira] [Created] (ARIES-1883) kafka based implementation

2019-01-10 Thread Christian Schneider (JIRA)
Christian Schneider created ARIES-1883:
--

 Summary: kafka based implementation
 Key: ARIES-1883
 URL: https://issues.apache.org/jira/browse/ARIES-1883
 Project: Aries
  Issue Type: New Feature
  Components: Journaled Events
Reporter: Christian Schneider
 Fix For: journaled-events-0.1.0






--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1881) Mongo based implementation

2019-01-10 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16739812#comment-16739812
 ] 

ASF subversion and git services commented on ARIES-1881:


Commit 4c15ecf4ae69bf4dbc56be1f4c7f7f674a8305be in aries-journaled-events's 
branch refs/heads/master from Alexei Krainiouk
[ https://gitbox.apache.org/repos/asf?p=aries-journaled-events.git;h=4c15ecf ]

ARIES-1881 Mongo based implementation
- Copyright notice updated in test classes.


> Mongo based implementation
> --
>
> Key: ARIES-1881
> URL: https://issues.apache.org/jira/browse/ARIES-1881
> Project: Aries
>  Issue Type: New Feature
>  Components: Journaled Events
>Reporter: Christian Schneider
>Priority: Major
> Fix For: journaled-events-0.1.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1881) Mongo based implementation

2019-01-10 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16739811#comment-16739811
 ] 

ASF subversion and git services commented on ARIES-1881:


Commit 79761f01937af95069d7cf367732a17f3a86 in aries-journaled-events's 
branch refs/heads/master from Alexei Krainiouk
[ https://gitbox.apache.org/repos/asf?p=aries-journaled-events.git;h=797 ]

ARIES-1881 Mongo based implementation
- Added few unit tests. In order to enable use aries.events.test.mongoUri 
system property which should point to a running mongodb instance


> Mongo based implementation
> --
>
> Key: ARIES-1881
> URL: https://issues.apache.org/jira/browse/ARIES-1881
> Project: Aries
>  Issue Type: New Feature
>  Components: Journaled Events
>Reporter: Christian Schneider
>Priority: Major
> Fix For: journaled-events-0.1.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] cschneider closed pull request #16: ARIES-1881 Mongo based implementation

2019-01-10 Thread GitBox
cschneider closed pull request #16: ARIES-1881 Mongo based implementation
URL: https://github.com/apache/aries-journaled-events/pull/16
 
 
   

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/Message.java
 
b/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/Message.java
index 529c980..44b77df 100644
--- 
a/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/Message.java
+++ 
b/org.apache.aries.events.api/src/main/java/org/apache/aries/events/api/Message.java
@@ -17,10 +17,13 @@
  */
 package org.apache.aries.events.api;
 
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 
 import static java.util.Collections.unmodifiableMap;
+import static java.util.Objects.requireNonNull;
 
 /**
  * TODO If we allow wild card consumption then a message also needs a topic
@@ -31,6 +34,8 @@
 private final Map properties;
 
 public Message(byte[] payload, Map properties) {
+requireNonNull(payload);
+requireNonNull(properties);
 this.payload = payload.clone();
 this.properties = unmodifiableMap(new HashMap<>(properties));
 }
@@ -43,4 +48,25 @@ public Message(byte[] payload, Map 
properties) {
 return properties;
 }
 
+@Override
+public String toString() {
+return "Message" + properties;
+}
+
+@Override
+public boolean equals(Object o) {
+if (this == o) return true;
+if (o == null || getClass() != o.getClass()) return false;
+Message message = (Message) o;
+return Arrays.equals(payload, message.payload) &&
+properties.equals(message.properties);
+}
+
+@Override
+public int hashCode() {
+int result = Objects.hash(properties);
+result = 31 * result + Arrays.hashCode(payload);
+return result;
+}
+
 }
diff --git 
a/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MessageReceiverImpl.java
 
b/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MessageReceiverImpl.java
index 2bf838f..f03f701 100644
--- 
a/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MessageReceiverImpl.java
+++ 
b/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MessageReceiverImpl.java
@@ -100,7 +100,7 @@ public void close() {
 private volatile boolean interrupted = false;
 
 private MessageReceiverImpl(MongoCollection col, 
Optional mongoClient) {
-LOGGER.info("Creating new receiver: " + 
col.getNamespace().getCollectionName());
+LOGGER.debug("Creating new receiver: " + 
col.getNamespace().getCollectionName());
 this.mongoClient = mongoClient;
 this.col = col;
 }
diff --git 
a/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MessageSenderImpl.java
 
b/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MessageSenderImpl.java
index 849e91f..7f60be1 100644
--- 
a/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MessageSenderImpl.java
+++ 
b/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MessageSenderImpl.java
@@ -70,7 +70,7 @@ public void close() {}
 private final long maxAge;
 
 private MessageSenderImpl(MongoCollection collection, long 
maxAge) {
-LOGGER.info("Creating new publisher: " + 
collection.getNamespace().getCollectionName());
+LOGGER.debug("Creating new publisher: " + 
collection.getNamespace().getCollectionName());
 ensureIndexes(collection);
 this.collection = collection;
 this.maxAge = maxAge;
diff --git 
a/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MongoSubscription.java
 
b/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MongoSubscription.java
index ea95f2f..f991502 100644
--- 
a/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MongoSubscription.java
+++ 
b/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MongoSubscription.java
@@ -22,12 +22,8 @@
 import org.apache.aries.events.api.Received;
 import org.apache.aries.events.api.Seek;
 import org.apache.aries.events.api.Subscription;
-import org.bson.Document;
 import org.slf4j.Logger;
 
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
 import java.util.function.Consumer;
 
 import static java.lang.Thread.currentThread;
@@ -114,7 +110,7 @@ private void poll(MessageReceiver receiver) {
 while (!interrupted()) {
 try {
 Message message = receiver.receive(index);
-LOGGER.in

Re: Journaled events MongoDB implementation

2019-01-10 Thread Alexei Krainiouk
Thanks for the warm welcome Christian! Hope to be of use.

The initial implementation is already there. It currently lacks any tests but I 
have added some in my next PR.
Will be adding more gradually.

Cheers

Alexei

> On Jan 7, 2019, at 1:15 AM, Christian Schneider  
> wrote:
> 
> Hi Alexei,
> 
> welcome at Aries. I am very interested in a mongo based implementation. It
> suits very well the Adobe experience manager deployments as we already use
> mongo db for the AEM repository. So doing the journal via mongo allows to
> deploy with less moving parts than e.g. apache kafka.
> 
> Please provide code changes in form of Pull Requests. Unfortunately I still
> do not have a PR build running on jenkins. So we do not yet have automated
> checks there. I can review the PRs.
> 
> For any larger changes it is also a good idea to create a jira issue. For
> the mongo based implementation I created
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FARIES-1881&data=02%7C01%7Cakrainio%40adobe.com%7C80235ebd1536441a21e708d67480a448%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636824493202543954&sdata=%2BenCmqnSm8PgyAriJaBoB%2BylC1bGesoTJdLFoaaPQD4%3D&reserved=0.
>  You can refer to it in
> commits like "ARIES-1881 - your commit message". This allows to see the
> commits linked in the jira issue.
> 
> Cheers
> 
> Christian
> 
> 
> 
> Am Fr., 4. Jan. 2019 um 22:40 Uhr schrieb Alexei Krainiouk
> :
> 
>> Hi
>> 
>> I would like to offer to contribute MongoDB based implementation to event
>> journal sub project [1]
>> 
>> A bit of myself:
>> 
>> My name is Alexei Krainiouk and I’ve been developer at Adobe for over 10
>> years, based in San Francisco, Bay Area.
>> 
>> Recently I joined the team that works on cloud development of Adobe
>> Experience Manager. Currently working together with Timothee Maret and
>> Christian Schneider on AEM content publishing.
>> 
>> As Timothee described earlier in this forum we have Kafka based
>> implementation of content publishing that he already offered to contribute.
>> I am working on the MongoDB implementation and it would make sense to have
>> it as an alternative back end for journaled event API as well.
>> 
>> Please let me know if this would be useful/interesting.
>> 
>> Regards
>> 
>> Alexei
>> [0]
>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.apache.org%2Fthread.html%2F47c4c103c026ad57887796d400c6ae6004fa8346346d8b4321ceceee%40%253Cdev.aries.apache.org%253E&data=02%7C01%7Cakrainio%40adobe.com%7C80235ebd1536441a21e708d67480a448%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636824493202543954&sdata=UcDIeHyW3%2FJBbiCcJRheuhxEozVtQtQVDd46kKVEMUU%3D&reserved=0
>> [1] 
>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Faries-journaled-events&data=02%7C01%7Cakrainio%40adobe.com%7C80235ebd1536441a21e708d67480a448%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636824493202543954&sdata=cClm51kJhpVguIQ6vMbpETO1UobS1uRlB58FhcFhULY%3D&reserved=0
>> 
>> 
>> 
>> 
>> 
> 
> -- 
> -- 
> Christian Schneider
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.liquid-reality.de&data=02%7C01%7Cakrainio%40adobe.com%7C80235ebd1536441a21e708d67480a448%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636824493202543954&sdata=X%2FdvO2mEwMZWSE7lUmA5W0huOdTsed4FZIyGeD63jPw%3D&reserved=0
> 
> Computer Scientist
> http://www.adobe.com



[jira] [Updated] (ARIES-1849) Aries proxy does not work with interface default methods

2019-01-10 Thread JIRA


 [ 
https://issues.apache.org/jira/browse/ARIES-1849?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jean-Baptiste Onofré updated ARIES-1849:

Fix Version/s: proxy-impl-1.1.4

> Aries proxy does not work with interface default methods
> 
>
> Key: ARIES-1849
> URL: https://issues.apache.org/jira/browse/ARIES-1849
> Project: Aries
>  Issue Type: Bug
>  Components: Proxy
>Affects Versions: proxy-impl-1.1.2
>Reporter: Nicolas Dutertry
>Assignee: Jean-Baptiste Onofré
>Priority: Major
> Fix For: proxy-impl-1.1.4
>
>
> Since Java 8 it is possible to define default implementations inside 
> interface definition.
> It seems that Aries proxy is not compatible with interface default methods. 
> As a result it is not possible to use a blueprint reference to a service 
> implementing an interface with default method.
> The following unit test demonstrates the issue :
> {code:java}
> import java.util.Collections;
> import org.apache.aries.proxy.UnableToProxyException;
> import org.apache.aries.proxy.impl.interfaces.InterfaceProxyGenerator;
> import org.junit.Assert;
> import org.junit.Test;
> public class InterfaceProxyGeneratorTest {
>     public static interface Service {
>     String getName();
>     
>     default String getValue() {
>     return "default";
>     }
>     }
>     
>     public static class ServiceImpl implements Service {
>     @Override
>     public String getName() {
>     return "serviceimpl";
>     }
>     
>     @Override
>     public String getValue() {
>     return "value";
>     }
>     }
>     
>     @Test
>     public void testProxy() throws UnableToProxyException {
>     ServiceImpl serviceImpl = new ServiceImpl();
>     Assert.assertEquals("serviceimpl", serviceImpl.getName());
>     Assert.assertEquals("value", serviceImpl.getValue());
>     
>     Service proxy = (Service)InterfaceProxyGenerator.getProxyInstance(
>     null, null, Collections.singleton(Service.class),
>     () -> {
>     return serviceImpl;
>     },
>     null);
>     
>     Assert.assertNotNull(proxy);    
>     Assert.assertEquals("serviceimpl", proxy.getName());
>     Assert.assertEquals("value", proxy.getValue());
>     }
> }{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (ARIES-1849) Aries proxy does not work with interface default methods

2019-01-10 Thread JIRA


 [ 
https://issues.apache.org/jira/browse/ARIES-1849?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jean-Baptiste Onofré reassigned ARIES-1849:
---

Assignee: Jean-Baptiste Onofré

> Aries proxy does not work with interface default methods
> 
>
> Key: ARIES-1849
> URL: https://issues.apache.org/jira/browse/ARIES-1849
> Project: Aries
>  Issue Type: Bug
>  Components: Proxy
>Affects Versions: proxy-impl-1.1.2
>Reporter: Nicolas Dutertry
>Assignee: Jean-Baptiste Onofré
>Priority: Major
>
> Since Java 8 it is possible to define default implementations inside 
> interface definition.
> It seems that Aries proxy is not compatible with interface default methods. 
> As a result it is not possible to use a blueprint reference to a service 
> implementing an interface with default method.
> The following unit test demonstrates the issue :
> {code:java}
> import java.util.Collections;
> import org.apache.aries.proxy.UnableToProxyException;
> import org.apache.aries.proxy.impl.interfaces.InterfaceProxyGenerator;
> import org.junit.Assert;
> import org.junit.Test;
> public class InterfaceProxyGeneratorTest {
>     public static interface Service {
>     String getName();
>     
>     default String getValue() {
>     return "default";
>     }
>     }
>     
>     public static class ServiceImpl implements Service {
>     @Override
>     public String getName() {
>     return "serviceimpl";
>     }
>     
>     @Override
>     public String getValue() {
>     return "value";
>     }
>     }
>     
>     @Test
>     public void testProxy() throws UnableToProxyException {
>     ServiceImpl serviceImpl = new ServiceImpl();
>     Assert.assertEquals("serviceimpl", serviceImpl.getName());
>     Assert.assertEquals("value", serviceImpl.getValue());
>     
>     Service proxy = (Service)InterfaceProxyGenerator.getProxyInstance(
>     null, null, Collections.singleton(Service.class),
>     () -> {
>     return serviceImpl;
>     },
>     null);
>     
>     Assert.assertNotNull(proxy);    
>     Assert.assertEquals("serviceimpl", proxy.getName());
>     Assert.assertEquals("value", proxy.getValue());
>     }
> }{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1849) Aries proxy does not work with interface default methods

2019-01-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16739484#comment-16739484
 ] 

ASF GitHub Bot commented on ARIES-1849:
---

GitHub user rovarga opened a pull request:

https://github.com/apache/aries/pull/94

[ARIES-1849] do not use invokevirtual for interface default methods

A default method is still an interface method, hence we should use 
invokeinterface, not invokevirtual, otherwise we will get an 
IncompatibleClassChangeError from hotspot.

Signed-off-by: Robert Varga 

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/rovarga/aries aries1849

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/aries/pull/94.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #94


commit 00ea87b194df241765df0c4af324735a16f70345
Author: Robert Varga 
Date:   2019-01-10T14:51:48Z

[ARIES-1849] do not use invokevirtual for interface default methods

Signed-off-by: Robert Varga 




> Aries proxy does not work with interface default methods
> 
>
> Key: ARIES-1849
> URL: https://issues.apache.org/jira/browse/ARIES-1849
> Project: Aries
>  Issue Type: Bug
>  Components: Proxy
>Affects Versions: proxy-impl-1.1.2
>Reporter: Nicolas Dutertry
>Priority: Major
>
> Since Java 8 it is possible to define default implementations inside 
> interface definition.
> It seems that Aries proxy is not compatible with interface default methods. 
> As a result it is not possible to use a blueprint reference to a service 
> implementing an interface with default method.
> The following unit test demonstrates the issue :
> {code:java}
> import java.util.Collections;
> import org.apache.aries.proxy.UnableToProxyException;
> import org.apache.aries.proxy.impl.interfaces.InterfaceProxyGenerator;
> import org.junit.Assert;
> import org.junit.Test;
> public class InterfaceProxyGeneratorTest {
>     public static interface Service {
>     String getName();
>     
>     default String getValue() {
>     return "default";
>     }
>     }
>     
>     public static class ServiceImpl implements Service {
>     @Override
>     public String getName() {
>     return "serviceimpl";
>     }
>     
>     @Override
>     public String getValue() {
>     return "value";
>     }
>     }
>     
>     @Test
>     public void testProxy() throws UnableToProxyException {
>     ServiceImpl serviceImpl = new ServiceImpl();
>     Assert.assertEquals("serviceimpl", serviceImpl.getName());
>     Assert.assertEquals("value", serviceImpl.getValue());
>     
>     Service proxy = (Service)InterfaceProxyGenerator.getProxyInstance(
>     null, null, Collections.singleton(Service.class),
>     () -> {
>     return serviceImpl;
>     },
>     null);
>     
>     Assert.assertNotNull(proxy);    
>     Assert.assertEquals("serviceimpl", proxy.getName());
>     Assert.assertEquals("value", proxy.getValue());
>     }
> }{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] aries pull request #94: [ARIES-1849] do not use invokevirtual for interface ...

2019-01-10 Thread rovarga
GitHub user rovarga opened a pull request:

https://github.com/apache/aries/pull/94

[ARIES-1849] do not use invokevirtual for interface default methods

A default method is still an interface method, hence we should use 
invokeinterface, not invokevirtual, otherwise we will get an 
IncompatibleClassChangeError from hotspot.

Signed-off-by: Robert Varga 

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/rovarga/aries aries1849

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/aries/pull/94.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #94


commit 00ea87b194df241765df0c4af324735a16f70345
Author: Robert Varga 
Date:   2019-01-10T14:51:48Z

[ARIES-1849] do not use invokevirtual for interface default methods

Signed-off-by: Robert Varga 




---


[GitHub] cschneider commented on issue #17: Journaled Event implementation based on Kafka

2019-01-10 Thread GitBox
cschneider commented on issue #17: Journaled Event implementation based on Kafka
URL: 
https://github.com/apache/aries-journaled-events/pull/17#issuecomment-453056812
 
 
   How about putting this into a single commit?


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:
us...@infra.apache.org


With regards,
Apache Git Services