[james-project] branch master updated: Upgrade EmailSubmissionSetMethodFutureReleaseTest for distributed test (#1635)

2023-07-09 Thread btellier
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
 new 572c4d76bf Upgrade EmailSubmissionSetMethodFutureReleaseTest for 
distributed test (#1635)
572c4d76bf is described below

commit 572c4d76bf86b9fe9691379b0a5052fb09cfe0c8
Author: vtbui <87489927+thanhbv200...@users.noreply.github.com>
AuthorDate: Mon Jul 10 10:45:55 2023 +0700

Upgrade EmailSubmissionSetMethodFutureReleaseTest for distributed test 
(#1635)
---
 ...dEmailSubmissionSetMethodFutureReleaseTest.java |  96 +++
 ...lSubmissionSetMethodFutureReleaseContract.scala | 105 -
 2 files changed, 175 insertions(+), 26 deletions(-)

diff --git 
a/server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/distributed/DistributedEmailSubmissionSetMethodFutureReleaseTest.java
 
b/server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/distributed/DistributedEmailSubmissionSetMethodFutureReleaseTest.java
new file mode 100644
index 00..1c67d4b24b
--- /dev/null
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/distributed/DistributedEmailSubmissionSetMethodFutureReleaseTest.java
@@ -0,0 +1,96 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james.jmap.rfc8621.distributed;
+
+import org.apache.james.CassandraExtension;
+import org.apache.james.CassandraRabbitMQJamesConfiguration;
+import org.apache.james.CassandraRabbitMQJamesServerMain;
+import org.apache.james.ClockExtension;
+import org.apache.james.DockerOpenSearchExtension;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JamesServerBuilder;
+import org.apache.james.JamesServerExtension;
+import org.apache.james.SearchConfiguration;
+import 
org.apache.james.jmap.rfc8621.contract.EmailSubmissionSetMethodFutureReleaseContract;
+import org.apache.james.jmap.rfc8621.contract.probe.DelegationProbeModule;
+import org.apache.james.mailbox.cassandra.ids.CassandraMessageId;
+import org.apache.james.mailbox.model.MessageId;
+import org.apache.james.modules.AwsS3BlobStoreExtension;
+import org.apache.james.modules.RabbitMQExtension;
+import org.apache.james.modules.TestJMAPServerModule;
+import org.apache.james.modules.blobstore.BlobStoreConfiguration;
+import org.apache.james.utils.UpdatableTickingClock;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import com.datastax.oss.driver.api.core.uuid.Uuids;
+import com.google.inject.name.Names;
+
+public class DistributedEmailSubmissionSetMethodFutureReleaseTest implements 
EmailSubmissionSetMethodFutureReleaseContract {
+public static final CassandraMessageId.Factory MESSAGE_ID_FACTORY = new 
CassandraMessageId.Factory();
+
+@RegisterExtension
+static JamesServerExtension testExtension = new 
JamesServerBuilder(tmpDir ->
+CassandraRabbitMQJamesConfiguration.builder()
+.workingDirectory(tmpDir)
+.configurationFromClasspath()
+.enableJMAP()
+.blobStore(BlobStoreConfiguration.builder()
+.s3()
+.disableCache()
+.deduplication()
+.noCryptoConfig())
+.searchConfiguration(SearchConfiguration.openSearch())
+.build())
+.extension(new DockerOpenSearchExtension())
+.extension(new CassandraExtension())
+.extension(new RabbitMQExtension())
+.extension(new 

[GitHub] [james-project] chibenwa merged pull request #1635: [JAMES-3822] Upgrade EmailSubmissionSetMethodFutureReleaseTest for distributed test

2023-07-09 Thread via GitHub


chibenwa merged PR #1635:
URL: https://github.com/apache/james-project/pull/1635


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[GitHub] [james-project] vttranlina opened a new pull request, #1640: [UPGRADE] Maven surefire plugin/ surefire report plugin: 2.22.2 -> 3.1.2

2023-07-09 Thread via GitHub


vttranlina opened a new pull request, #1640:
URL: https://github.com/apache/james-project/pull/1640

   (no comment)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[GitHub] [james-project] Arsnael commented on a diff in pull request #1637: James 2600 implement an object storage healthcheck

2023-07-09 Thread via GitHub


Arsnael commented on code in PR #1637:
URL: https://github.com/apache/james-project/pull/1637#discussion_r1257648945


##
server/blob/blob-api/src/main/java/org/apache/james/blob/api/ObjectStorageHealthCheck.java:
##
@@ -0,0 +1,59 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james.blob.api;
+
+import java.time.Duration;
+
+import javax.inject.Inject;
+
+import org.apache.james.core.healthcheck.ComponentName;
+import org.apache.james.core.healthcheck.HealthCheck;
+import org.apache.james.core.healthcheck.Result;
+
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+public class ObjectStorageHealthCheck implements HealthCheck {
+
+private static final Integer HEALTH_CHECK_TIMEOUT = 10;
+
+private static final ComponentName COMPONENT_NAME = new 
ComponentName("ObjectStorage");
+
+private final BlobStoreDAO blobStoreDAO;
+
+@Inject
+public ObjectStorageHealthCheck(BlobStoreDAO blobStoreDAO) {
+this.blobStoreDAO = blobStoreDAO;
+}
+
+@Override
+public ComponentName componentName() {
+return COMPONENT_NAME;
+}
+
+@Override
+public Mono check() {
+return Flux.from(blobStoreDAO.listBuckets())

Review Comment:
   listBuckets is a relatively cheap request, think it is ok to use it for a 
healthcheck



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[GitHub] [james-project] chibenwa commented on pull request #1637: James 2600 implement an object storage healthcheck

2023-07-09 Thread via GitHub


chibenwa commented on PR #1637:
URL: https://github.com/apache/james-project/pull/1637#issuecomment-1627959585

   This test is failing 
`org.apache.james.webadmin.integration.rabbitmq.RabbitMQWebAdminServerIntegrationImmutableTest.healthCheckComponentsList`
 ;-)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[james-project] branch master updated: JAMES-2287 HashBlobId.Factory support encoding type (#1632)

2023-07-09 Thread btellier
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
 new c1c9c268f3 JAMES-2287 HashBlobId.Factory support encoding type (#1632)
c1c9c268f3 is described below

commit c1c9c268f3f42a18387b3a2bba2e08a3270eb956
Author: vttran 
AuthorDate: Mon Jul 10 09:01:01 2023 +0700

JAMES-2287 HashBlobId.Factory support encoding type (#1632)
---
 .../docs/modules/ROOT/pages/configure/jvm.adoc |  12 ++
 .../java/org/apache/james/blob/api/HashBlobId.java |  33 +-
 .../org/apache/james/blob/api/HashBlobIdTest.java  |  42 ++-
 server/blob/blob-s3/pom.xml|   5 +
 .../james/blob/objectstorage/aws/S3MinioTest.java  | 123 +
 src/site/xdoc/server/config-system.xml |   3 +
 6 files changed, 214 insertions(+), 4 deletions(-)

diff --git 
a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jvm.adoc 
b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jvm.adoc
index f0440ab4b2..d95acb2414 100644
--- a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jvm.adoc
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jvm.adoc
@@ -53,3 +53,15 @@ james.protocols.mdc.hostname=false
 
 Optional. Boolean. Defaults to true.
 
+== Change the encoding type used for the blobId
+
+By default, the blobId is encoded in base64 url. The property 
`james.blob.id.hash.encoding` allows to change the encoding type.
+The support value are: base16, hex, base32, base32Hex, base64, base64Url.
+
+Ex in `jvm.properties`
+
+james.blob.id.hash.encoding=base16
+
+
+Optional. String. Defaults to base64Url.
+
diff --git 
a/server/blob/blob-api/src/main/java/org/apache/james/blob/api/HashBlobId.java 
b/server/blob/blob-api/src/main/java/org/apache/james/blob/api/HashBlobId.java
index e716df4040..55c1329e27 100644
--- 
a/server/blob/blob-api/src/main/java/org/apache/james/blob/api/HashBlobId.java
+++ 
b/server/blob/blob-api/src/main/java/org/apache/james/blob/api/HashBlobId.java
@@ -20,7 +20,7 @@
 package org.apache.james.blob.api;
 
 import java.io.IOException;
-import java.util.Base64;
+import java.util.Optional;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.MoreObjects;
@@ -29,11 +29,22 @@ import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
 import com.google.common.hash.HashCode;
 import com.google.common.hash.Hashing;
+import com.google.common.io.BaseEncoding;
 import com.google.common.io.ByteSource;
 
 public class HashBlobId implements BlobId {
+private static final String HASH_BLOB_ID_ENCODING_TYPE_PROPERTY = 
"james.blob.id.hash.encoding";
+private static final BaseEncoding HASH_BLOB_ID_ENCODING_DEFAULT = 
BaseEncoding.base64Url();
 
 public static class Factory implements BlobId.Factory {
+private final BaseEncoding baseEncoding;
+
+public Factory() {
+this.baseEncoding = 
Optional.ofNullable(System.getProperty(HASH_BLOB_ID_ENCODING_TYPE_PROPERTY))
+.map(Factory::baseEncodingFrom)
+.orElse(HASH_BLOB_ID_ENCODING_DEFAULT);
+}
+
 @Override
 public HashBlobId forPayload(byte[] payload) {
 Preconditions.checkArgument(payload != null);
@@ -51,7 +62,7 @@ public class HashBlobId implements BlobId {
 
 private HashBlobId base64(HashCode hashCode) {
 byte[] bytes = hashCode.asBytes();
-return new HashBlobId(Base64.getEncoder().encodeToString(bytes));
+return new HashBlobId(baseEncoding.encode(bytes));
 }
 
 @Override
@@ -59,6 +70,24 @@ public class HashBlobId implements BlobId {
 Preconditions.checkArgument(!Strings.isNullOrEmpty(id));
 return new HashBlobId(id);
 }
+
+private static BaseEncoding baseEncodingFrom(String encodingType) {
+switch (encodingType) {
+case "base16":
+case "hex":
+return BaseEncoding.base16();
+case "base64":
+return BaseEncoding.base64();
+case "base64Url":
+return BaseEncoding.base64Url();
+case "base32":
+return BaseEncoding.base32();
+case "base32Hex":
+return BaseEncoding.base32Hex();
+default:
+throw new IllegalArgumentException("Unknown encoding type: 
" + encodingType);
+}
+}
 }
 
 private final String id;
diff --git 
a/server/blob/blob-api/src/test/java/org/apache/james/blob/api/HashBlobIdTest.java
 
b/server/blob/blob-api/src/test/java/org/apache/james/blob/api/HashBlobIdTest.java
index 026a57d9f8..88fe109973 100644
--- 

[GitHub] [james-project] chibenwa merged pull request #1632: JAMES-2287 HashBlobId.Factory support encoding type

2023-07-09 Thread via GitHub


chibenwa merged PR #1632:
URL: https://github.com/apache/james-project/pull/1632


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[james-project] branch master updated: Move rabbitMQ channel close operation to boundedElastic thread (#1639)

2023-07-09 Thread btellier
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
 new 3011d23f9a Move rabbitMQ channel close operation to boundedElastic 
thread (#1639)
3011d23f9a is described below

commit 3011d23f9a2837e245a2616391168f51f765f195
Author: Arooba Shahoor <56495631+arooba-...@users.noreply.github.com>
AuthorDate: Mon Jul 10 10:59:35 2023 +0900

Move rabbitMQ channel close operation to boundedElastic thread (#1639)

This prevents the call from blocking the reactive pipeline
---
 .../apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java| 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java
 
b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java
index fc65f6b1d6..80368108ca 100644
--- 
a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java
+++ 
b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java
@@ -685,7 +685,9 @@ public class ReactorRabbitMQChannelPool implements 
ChannelPool, Startable {
 if (channel.isOpen()) {
 channel.close();
 }
-})))
+}))
+.then()
+.subscribeOn(Schedulers.boundedElastic()))
 .buildPool();
 }
 


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[GitHub] [james-project] chibenwa commented on pull request #1639: Move rabbitMQ channel close operation to boundedElastic thread

2023-07-09 Thread via GitHub


chibenwa commented on PR #1639:
URL: https://github.com/apache/james-project/pull/1639#issuecomment-1627957035

   Thanks a lot for this contribution!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[GitHub] [james-project] chibenwa merged pull request #1639: Move rabbitMQ channel close operation to boundedElastic thread

2023-07-09 Thread via GitHub


chibenwa merged PR #1639:
URL: https://github.com/apache/james-project/pull/1639


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org