From daffd7d11f24bbd1e34c708f533bb534ed6e7d84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Apr 2020 03:24:58 +0000 Subject: [PATCH 01/58] Bump node-uuid from 1.4.3 to 1.4.8 in /src/client/nodejs Bumps [node-uuid](https://github.com/broofa/node-uuid) from 1.4.3 to 1.4.8. - [Release notes](https://github.com/broofa/node-uuid/releases) - [Changelog](https://github.com/broofa/node-uuid/blob/master/HISTORY.md) - [Commits](https://github.com/broofa/node-uuid/commits) Signed-off-by: dependabot[bot] --- src/client/nodejs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/nodejs/package.json b/src/client/nodejs/package.json index 07a5da8..13a1a99 100644 --- a/src/client/nodejs/package.json +++ b/src/client/nodejs/package.json @@ -2,7 +2,7 @@ "name": "vertx3-eventbus-client", "description": "Vert.x3 TCP event bus client", "dependencies": { - "node-uuid": "1.4.3" + "node-uuid": "1.4.8" }, "devDependencies": { "mocha": "2.3.3" From 1412bcd9436fc7c2551e91e7428cc677531c1551 Mon Sep 17 00:00:00 2001 From: Lin Gao Date: Mon, 13 Apr 2020 17:18:08 +0800 Subject: [PATCH 02/58] [Issue-52] Improve tests Introduce SSLKeyPairCerts to generate SSL key pairs and certificates instead of having the keystore files --- pom.xml | 6 + .../eventbus/bridge/tcp/SSLKeyPairCerts.java | 188 ++++++++++++++++++ .../tcp/TcpEventBusBridgeEventTest.java | 56 ++++-- src/test/resources/.gitkeep | 0 src/test/resources/client.keystore | Bin 2339 -> 0 bytes src/test/resources/client.truststore | Bin 2104 -> 0 bytes src/test/resources/server.keystore | Bin 2376 -> 0 bytes src/test/resources/server.truststore | Bin 2142 -> 0 bytes 8 files changed, 229 insertions(+), 21 deletions(-) create mode 100644 src/test/java/io/vertx/ext/eventbus/bridge/tcp/SSLKeyPairCerts.java create mode 100644 src/test/resources/.gitkeep delete mode 100644 src/test/resources/client.keystore delete mode 100644 src/test/resources/client.truststore delete mode 100644 src/test/resources/server.keystore delete mode 100644 src/test/resources/server.truststore diff --git a/pom.xml b/pom.xml index 42f34b8..01d2534 100644 --- a/pom.xml +++ b/pom.xml @@ -84,5 +84,11 @@ vertx-unit test + + org.bouncycastle + bcpkix-jdk15on + 1.65 + test + diff --git a/src/test/java/io/vertx/ext/eventbus/bridge/tcp/SSLKeyPairCerts.java b/src/test/java/io/vertx/ext/eventbus/bridge/tcp/SSLKeyPairCerts.java new file mode 100644 index 0000000..46fe10d --- /dev/null +++ b/src/test/java/io/vertx/ext/eventbus/bridge/tcp/SSLKeyPairCerts.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2020 Red Hat, Inc. and others + * + * Red Hat 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 io.vertx.ext.eventbus.bridge.tcp; + +import io.vertx.core.buffer.Buffer; +import io.vertx.core.net.JksOptions; +import org.bouncycastle.asn1.x500.X500Name; +import org.bouncycastle.asn1.x509.AlgorithmIdentifier; +import org.bouncycastle.asn1.x509.GeneralName; +import org.bouncycastle.asn1.x509.GeneralNames; +import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; +import org.bouncycastle.cert.X509CertificateHolder; +import org.bouncycastle.cert.X509v3CertificateBuilder; +import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; +import org.bouncycastle.crypto.params.AsymmetricKeyParameter; +import org.bouncycastle.crypto.util.PrivateKeyFactory; +import org.bouncycastle.operator.ContentSigner; +import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder; +import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder; +import org.bouncycastle.operator.bc.BcContentSignerBuilder; +import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder; + +import java.io.ByteArrayOutputStream; +import java.math.BigInteger; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.KeyStore; +import java.security.NoSuchAlgorithmException; +import java.security.cert.Certificate; +import java.security.cert.X509Certificate; +import java.util.Date; + +/** + * Util class to generate SSL key pairs and certificates for test purpose. + * + * All generated key pairs and certificates are in memory. + * + * @author Lin Gao + */ +public class SSLKeyPairCerts { + + private static final String SERVER_CERT_SUBJECT = "CN=Vertx Server, OU=Middleware Runtime, O=Red Hat, C=US"; + private static final String CLIENT_CERT_SUBJECT = "CN=Vertx Client, OU=Middleware Runtime, O=Red Hat, C=US"; + private static final String PASSWORD = "wibble"; + + private JksOptions serverKeyStore; + private JksOptions serverTrustStore; + private JksOptions clientKeyStore; + private JksOptions clientTrustStore; + + public SSLKeyPairCerts() { + } + + /** + * Creates 2 way SSL key pairs and certificates. + * + *

+ * This will initialize 4 KeyStores in JKS type: + *

+ *

+ * @return self + */ + public SSLKeyPairCerts createTwoWaySSL() { + try { + KeyPair serverRSAKeyPair = generateRSAKeyPair(2048); + Certificate serverCert = generateSelfSignedCert(SERVER_CERT_SUBJECT, serverRSAKeyPair); + + KeyPair clientRSAKeyPair = generateRSAKeyPair(2048); + Certificate clientCert = generateSelfSignedCert(CLIENT_CERT_SUBJECT, clientRSAKeyPair); + + KeyStore serverKeyStore = emptyJKSStore(PASSWORD); + serverKeyStore.setKeyEntry("localserver", serverRSAKeyPair.getPrivate(), PASSWORD.toCharArray(), new Certificate[]{serverCert}); + + KeyStore serverTrustStore = emptyJKSStore(PASSWORD); + serverTrustStore.setCertificateEntry("clientcert", clientCert); + + KeyStore clientKeyStore = emptyJKSStore(PASSWORD); + clientKeyStore.setKeyEntry("localclient", clientRSAKeyPair.getPrivate(), PASSWORD.toCharArray(), new Certificate[]{clientCert}); + + KeyStore clientTrustStore = emptyJKSStore(PASSWORD); + clientTrustStore.setCertificateEntry("servercert", serverCert); + + ByteArrayOutputStream serverKeyStoreOutputStream = new ByteArrayOutputStream(512); + serverKeyStore.store(serverKeyStoreOutputStream, PASSWORD.toCharArray()); + this.serverKeyStore = new JksOptions().setPassword(PASSWORD).setValue(Buffer.buffer(serverKeyStoreOutputStream.toByteArray())); + + ByteArrayOutputStream serverTrustStoreOutputStream = new ByteArrayOutputStream(512); + serverTrustStore.store(serverTrustStoreOutputStream, PASSWORD.toCharArray()); + this.serverTrustStore = new JksOptions().setPassword(PASSWORD).setValue(Buffer.buffer(serverTrustStoreOutputStream.toByteArray())); + + ByteArrayOutputStream clientKeyStoreOutputStream = new ByteArrayOutputStream(512); + clientKeyStore.store(clientKeyStoreOutputStream, PASSWORD.toCharArray()); + this.clientKeyStore = new JksOptions().setPassword(PASSWORD).setValue(Buffer.buffer(clientKeyStoreOutputStream.toByteArray())); + + ByteArrayOutputStream clientTrustStoreOutputStream = new ByteArrayOutputStream(512); + clientTrustStore.store(clientTrustStoreOutputStream, PASSWORD.toCharArray()); + this.clientTrustStore = new JksOptions().setPassword(PASSWORD).setValue(Buffer.buffer(clientTrustStoreOutputStream.toByteArray())); + } catch (Exception e) { + throw new RuntimeException("Cannot generate SSL key pairs and certificates", e); + } + return this; + } + + // refer to: https://github.com/vert-x3/vertx-config/blob/4.0.0-milestone4/vertx-config-vault/src/test/java/io/vertx/config/vault/utils/Certificates.java#L149 + private X509Certificate generateSelfSignedCert(String certSub, KeyPair keyPair) throws Exception { + final X509v3CertificateBuilder certificateBuilder = new X509v3CertificateBuilder( + new org.bouncycastle.asn1.x500.X500Name(certSub), + BigInteger.ONE, + new Date(System.currentTimeMillis() - 1000L * 60 * 60 * 24 * 30), + new Date(System.currentTimeMillis() + (1000L * 60 * 60 * 24 * 30)), + new X500Name(certSub), + SubjectPublicKeyInfo.getInstance(keyPair.getPublic().getEncoded()) + ); + final GeneralNames subjectAltNames = new GeneralNames(new GeneralName(GeneralName.iPAddress, "127.0.0.1")); + certificateBuilder.addExtension(org.bouncycastle.asn1.x509.Extension.subjectAlternativeName, false, subjectAltNames); + + final AlgorithmIdentifier sigAlgId = new DefaultSignatureAlgorithmIdentifierFinder().find("SHA1WithRSAEncryption"); + final AlgorithmIdentifier digAlgId = new DefaultDigestAlgorithmIdentifierFinder().find(sigAlgId); + final BcContentSignerBuilder signerBuilder = new BcRSAContentSignerBuilder(sigAlgId, digAlgId); + final AsymmetricKeyParameter keyp = PrivateKeyFactory.createKey(keyPair.getPrivate().getEncoded()); + final ContentSigner signer = signerBuilder.build(keyp); + final X509CertificateHolder x509CertificateHolder = certificateBuilder.build(signer); + final X509Certificate certificate = new JcaX509CertificateConverter().getCertificate(x509CertificateHolder); + certificate.checkValidity(new Date()); + certificate.verify(keyPair.getPublic()); + return certificate; + } + + private KeyPair generateRSAKeyPair(int keySize) throws NoSuchAlgorithmException { + final KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(keySize); + return keyPairGenerator.genKeyPair(); + } + + private KeyStore emptyJKSStore(String password) throws Exception { + KeyStore ks = KeyStore.getInstance("JKS"); + ks.load(null, password.toCharArray()); + return ks; + } + + /** + * @return the server's keystore options + */ + public JksOptions getServerKeyStore() { + return serverKeyStore; + } + + /** + * @return the server's truststore options + */ + public JksOptions getServerTrustStore() { + return serverTrustStore; + } + + /** + * @return the client's keystore options + */ + public JksOptions getClientKeyStore() { + return clientKeyStore; + } + + /** + * @return the client's truststore options + */ + public JksOptions getClientTrustStore() { + return clientTrustStore; + } +} diff --git a/src/test/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridgeEventTest.java b/src/test/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridgeEventTest.java index 7f2c826..60037fa 100644 --- a/src/test/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridgeEventTest.java +++ b/src/test/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridgeEventTest.java @@ -17,6 +17,7 @@ import io.vertx.core.Vertx; import io.vertx.core.eventbus.Message; +import io.vertx.core.http.ClientAuth; import io.vertx.core.json.JsonObject; import io.vertx.core.impl.logging.Logger; import io.vertx.core.impl.logging.LoggerFactory; @@ -38,19 +39,20 @@ @RunWith(VertxUnitRunner.class) public class TcpEventBusBridgeEventTest { + private static final Logger logger = LoggerFactory.getLogger(TcpEventBusBridgeEventTest.class); + private Vertx vertx; + private SSLKeyPairCerts sslKeyPairCerts; + @Before public void before(TestContext context) { vertx = Vertx.vertx(); final Async async = context.async(); - vertx.eventBus().consumer("hello", (Message msg) -> msg.reply(new JsonObject().put("value", "Hello " + msg.body().getString("value")))); - vertx.eventBus().consumer("echo", (Message msg) -> msg.reply(msg.body())); - vertx.setPeriodic(1000, __ -> vertx.eventBus().send("ping", new JsonObject().put("value", "hi"))); - + sslKeyPairCerts = new SSLKeyPairCerts().createTwoWaySSL(); TcpEventBusBridge bridge = TcpEventBusBridge.create( vertx, new BridgeOptions() @@ -60,28 +62,23 @@ public void before(TestContext context) { .addOutboundPermitted(new PermittedOptions().setAddress("echo")) .addOutboundPermitted(new PermittedOptions().setAddress("ping")), new NetServerOptions() - .setSsl(true).setTrustStoreOptions(new JksOptions().setPath("server.truststore").setPassword("wibble")) - .setKeyStoreOptions(new JksOptions().setPath("server.keystore").setPassword("wibble")), + .setClientAuth(ClientAuth.REQUEST) + .setSsl(true) + .setTrustStoreOptions(sslKeyPairCerts.getServerTrustStore()) + .setKeyStoreOptions(sslKeyPairCerts.getServerKeyStore()), be -> { - - Logger l = LoggerFactory.getLogger(this.getClass().getName()); - l.info("Handled a bridge event " + be.getRawMessage()); + logger.info("Handled a bridge event " + be.getRawMessage()); if (be.socket().isSsl()) { try { for (X509Certificate c : be.socket().peerCertificateChain()) { - l.info(c.getSubjectDN().toString()); + logger.info(c.getSubjectDN().toString()); } - } catch (SSLPeerUnverifiedException e) { - l.warn("Caught SSLPeerUnverifiedException when processing peerCertificateChain "); - //@fixme should have a test truststore/keystore that validates, the ones i made still throw this + throw new RuntimeException("Failed to get peer certificates chain", e); } } - be.complete(true); - }); - bridge.listen(7000, res -> { context.assertTrue(res.succeeded()); async.complete(); @@ -96,20 +93,37 @@ public void after(TestContext context) { @Test public void testSendVoidMessage(TestContext context) { // Send a request and get a response - NetClient client = vertx.createNetClient(new NetClientOptions().setSsl(true).setTrustAll(true) - .setKeyStoreOptions(new JksOptions().setPath("client.keystore").setPassword("wibble"))); + NetClient client = vertx.createNetClient(new NetClientOptions() + .setSsl(true) + .setTrustStoreOptions(sslKeyPairCerts.getClientTrustStore()) + .setKeyStoreOptions(sslKeyPairCerts.getClientKeyStore())); final Async async = context.async(); - vertx.eventBus().consumer("test", (Message msg) -> { client.close(); async.complete(); }); - client.connect(7000, "localhost", conn -> { context.assertFalse(conn.failed()); - NetSocket socket = conn.result(); + FrameHelper.sendFrame("send", "test", new JsonObject().put("value", "vert.x"), socket); + }); + } + @Test + public void testSendVoidMessageTrustAll(TestContext context) { + NetClient client = vertx.createNetClient(new NetClientOptions() + .setSsl(true) + .setTrustAll(true) + .setKeyStoreOptions(sslKeyPairCerts.getClientKeyStore()) + ); + final Async async = context.async(); + vertx.eventBus().consumer("test", (Message msg) -> { + client.close(); + async.complete(); + }); + client.connect(7000, "localhost", conn -> { + context.assertFalse(conn.failed()); + NetSocket socket = conn.result(); FrameHelper.sendFrame("send", "test", new JsonObject().put("value", "vert.x"), socket); }); } diff --git a/src/test/resources/.gitkeep b/src/test/resources/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/test/resources/client.keystore b/src/test/resources/client.keystore deleted file mode 100644 index 4eda90ea6d0f801433e397c8abdd71780d068b26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2339 zcmc&#c{J3E7oQE!GPbdY#@Mp<9s4{XTL@(zgbcp2t1-6hgRv(|WKBru327NimWXU2 zsb?umO+vg;7`)=C-#NeY{`md>JNMjk?!D)8&%Nh!KIh(p^@DW?1Ohv9=r3pY4Dbbm zNJ^d{k#tmZsgJHtgFu*I02y%ra5A$gFhdbgc^D5A$^=1>5vvcU&O`-60v^y;n!5uQ zW=cn|#=EMwbbdZ(7I!UkxYM4q;KrKhGNN5)sG`BW>WsL!`cstjcjD>p_%dXhXSCc{ zLg?45FRs}AAvM~=4FUfag6ZE<4%gWzGMHoM;Er^sR}1p37(!>)_YA$^z3r@njp_0e zJUN27>|-L2jUBz7oTOb7!VgZ4%x7Sf)G!S752DQ1mFF9Q=yU98yB3o-u2haK4T}+zi!FrNY#^%xJf>%%D?47eLj}W` zYdh-P9j4u^x32Km4X^kK5d%+c@m^4{GB!bR$`pAvX_%``yqR@`FP@*XP`tTx1v`n6 z%lRPCYdr8^nxBlH6nmsYmVQNNI11tSurD_@Vtchh!-#4Cb%$b|_fR{oQ}*y_Ik!_% z4azlaZJDoksymEp#?6m1>H4Q^lvyl`q>Kv{)GREK>ts&&otPD^6!)+NL6ejXzubjdt{(Noh(-I7q!MvoJ1F zsku?ZwXnM*mF>M@lKh|=vprsGB_igWC>deP=o_;rO>a+p&2P!TRr~upp5LFRN69wT z)YXIEQ3HI1JC>zFmY zr*IS*WyFVQ-Hhx&ijFQPrEgvJf2rix`f>crm{-A4^KQ(zGO{pRpnVh_w(0)uOmZ}R zGdxR5Ys_f8S~s5k{=if!i)l~mkx$W(GNXSqgyZzm zTJZwC!Y5IO#)x(Era6V_wNMLkWcVowv=apOGJhwjr0}ZsHlI(aPN!-|Ze}%m6fCaR zhQrJcc3-mV77U-l1e^O8oAIBhG<2ZTC8yb*$*Tk>XStCpGb{}!?^+JyzQhEg2U2d= z@z!kLTft@43H5qs%Pt{egI4PQnqqaCOrGY?Z?gZ6zCzK z*Y?CKF75TQ`!VObdG#(1^Szf(9XxKa{=7;a7R~+f?_;Yr@e3{jyZR;4T_a7QXkDBQvN^1_-bS)@yd66{nCiVMQXwbh(0KwcCEXV{2UZx5 z?D=_8i#lZ-dW}!2=)_-U)>Gts|J6PN>uPt0s+#?6vj6cgLyIaUtj+PIylTsgMPBi& z0VxB@TW19ti_GT9pGG+9FMIj)@Znx7??$LynM+U#*J_wnd&`+jYV;IYc(ZEc3bDq$ zm{)wR`bb|WM8@*dU*;E-8d1_ihpekUkiNc}ljG9=SW#dH_H`k3<61Lysy_KUs4F#iWG^q zAbDYV0q&m=I0tKFa3~QSLa4)sMMv zxGR=4uoVtC`#IL|J}aiIOTXvlv6^X9^^+Ny&&gGgosIXVwAl%FMBJUeUay;wKE{Yl zd~4`*uS^sglVaqcxo-{GTs9%@I*}a}vzp3-h6N0!bPJ8z-e>RE>hiw21_^?d&+rDO z^=G6Jw1w*!x>dxEQ|u&cm%*I`$a^V2c2Er}A{kb(sMWVDjdki(+v z$jfgrMiyIluSoLYFQC!saRGsYf`o|upnWksx!~rrUb>}n3=IZ{LZDSvz&SwdNCIM< z2mu72^S$f7jRD?c9r;fhbgk@{1n_p}e~Cy;5+MW##Q$#q$IpHgf(d{_p@;wG{79%r zoI@cGYMRX7U6Pw-Z#w}Tp22q5ovp~OF4b<1OfH?9o}vC#m0e}mg#!DCE6*i_oYP$i zrnR$m`q4BOmbnXcW~MKq!$#00!V**7Us`>s>C+-JcYJb5w6xfM$+mnkD$Q#28y$rz zn%+r*8%q}tWeU!Z^{pS^ccPrkL*yHNOs$=|Cx+XS0u8%<;8)z%D#gAYKP2$y#Z-%z z8JP9Ae}}3}Y1||Xj*KrhSWqQAI7~u%Nh(u3Cj6lLH{M%|5WJ67L7e9YBTSfGGtEe$ zZs2RH+fIl8SL#jG*ZmqQi5AJS6rQ5_yB2_qXmy6%47=Ui;GrSmOHZVYXeDNaOP>&k Xw>}1wEtpD=H^6C)$T!Q+4Bm5(jiCNMQY zXZBjI>Bpn8B9;jqn$`AJ^`3xWz^z@zS!!qQPn@K!e!C&9ZC8loo{Hr+C#^lFw zviZ7m;JXFPUun}Lmtz- zTSB>=$GSTcttD4g2+Z6mj&{nMg;g#9q*dnWDqMRB%W@w7(K zRs~&&Q(+I)&z$>Q>*Died7-jMc(j5-SA9D{!eg?9@Bp}PjBE}*TwR%G4`kb`$d!}q(YZnmuNGv?WADoC}m02VV#2TS31@_jbXnNz0%X;L`~Tlh1rsdSJU3?%-qp+Q|i{z zj7cR=JL`@q@0udJ<7vRz&mV+^XWsnQ!tAO#>r{{U{qslO{tN$B9qC=Hwf67T*EXwV zEx)LwI`97*{xa_MBH2&!{}V+g*DjHp>*RTC_a8>1t7bD2PoBB(aIMb{#Uvj0;=?6I zR|VZgQxiT5&40)co)IvuKKZeWQd!8xr!LwnkAK=3_pMlrzhj2+m1AZ`%|5N_ZGtoJ zFZVG}lUdTOd5b&bdj6?XlIh!3U7pVNoc`z;IP-HCrxpQo5>m#$dkvBCe*-iAcVNc9 z56k#h0%yJ`n&dMbEj$exClZnK1q}E=*_xe)Jue@eT}dkoBK<>y$SeztEsYG2$^tNV zP`a5=@v!l1wAbm-_Fvtm9kXHHw3B+FA!qJpZTyjTGoL4r_gMSoun94idPhZE zwv&mN0y-REnoww|>QDPWD5;Vb=b;^IKI+YW8c-k#|*Cn%{-eZjWD zDVlL(rB?il-EqIVCcR#Jt?K_q=~LS$xJB%Jz^ojjm*bSlCSuOeqRYk0XEn?} zR{rJd)?6FA>p@P|Mv)z6%jP_=yD)Wq;0Yn6Rwh<~)xz6d*|JsF@Vs7eOX#-K?AY5D z>d*h(PPG?sc>O%)-IMd!iifmH1}A2pyr5;%bw8!7*Iv$L>e7NzJYZEouy{zl{Y#_i z;ZHe{1CCcjmk6A{RP%p++own_gMFbQ(fb?QQ`)CpR+!l%t?PF~@w>(wmHYx@jwA99 ztW_A2^AC0JJy^$M8J8!r#4ETbadz6b&U9tpJ^NFfR|`+c6~9sP`;W$h+Bl1SK|xP&ptkbk+dES|nLN^aHdWj4d3Ld~&vA}iZ2RUM zV|vt|k4%&ACoc8dE8&p(pZ)fMrO}U?p3Jzq|6?u3;%J_T(7@wz?bH9vH}s24xOS;k z^>|aX=!3`i7e5M@;BS1fwZ7%`Lo2DS^p&<*i=LZ*`M7s=UhbNE-G2^utIyjRB5w06 dDcn^k;Y{X-r`Pg$?r5B>$|!9AzNjy$2>^wD4GaJP diff --git a/src/test/resources/server.keystore b/src/test/resources/server.keystore deleted file mode 100644 index c0d88438161ef517f1d99b25b41f9854733c9295..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2376 zcmd5-_fwPG7R{GN#|WW|Ql%+;i3mibBh5%riWoqUgib&Ry(lpd6r@R!E(R0{DnW%S zsDvm*?h_Oc(Wq1fq$r4>v^@09ytzNTKj6)oJ+t?kz4tk@X3aWV^IP)}2n4zvz@HF` zBt=A%BKG@|A}HIKM_oJ%4}l;6kP6=fMUjG9NB|CKLU#fH0s^PPXINE#fh&2bEP74#6J0){vjl3P1ieyRTk3n?d(Ct8bo&xJI$QRen?S`}(ZXzI^qoxWiTP{2y|BX-%la+W4@&$D92TLz zoRRO^?G8X|ZG0{x04xg6@!F*!A?Ato`Y>Dj2CWkv+sz0+Vvu=%`LmK=B`QxN;@16} zQ63SXh@GyN=r4EO=SgxI<=^hf+Z#0t=D98}wHy`LNryR8M1@*)<2y8FpW^S`yGWkw zuKIF7cVXCjhE?Z~1?nC?|wHcgGo=W4rQk@^pW-QU{<(vjp=vu+D`bSoyerde? z_pJKW2FZuC2tgt(*AgL|&jqxT7cCL;EgWh*qLS)$55Z6W(W?7F94(T(?@i z;P-+p9zBf1CM^XA+uJ=1h|&rwb`<-%7RvBfJ`k*_xdv}jJLP)FTEX6cbP?(2F;);%Z_2Q!WUwnV_QUj0!9;IE*kGjK=={%)9~EBY zhO4l)UGU^#_peYH(ymV>XB7*yg=%)Slb3TwUM&z(qpNLdInKU^QZMV&N}cU{DxPRK zeJ(()@8H<2P|Hq_cPa@kdkpnIJ6zTqNhq(;6H}u4Q6_d-wq!abDlqy>)$`kM^3S~a zbk0QMH*_Rq%D3!js0+A8=1XcmQ*W6X@ZPu)RpEsHe0}P)*~MJZ*MV=poXoHM+G&f3 z6LWy+KG+j8h1}tFA^&*b+bVyKK8lMpcx55PtODvJqQpyeWD(CARA{$on6Y{r%RF9; z-unis9HJurC))Z!PZxk=8xQ@;hf3ADU2YKqvA05>bJ<+u_WRm+`F<$%i zTxp!CZU-mJi!2l+Ieo24X)y2lPg%!R5&W|(qw3Z}gO~Qbc~U;u9&F0wh4EqEHOlU3 zzw)8U&{AY0B%8zY`Fbh!TmF3D8*+~8UX85go2gRgn~;53?ln6>qbToYX!D;vf*%I!J}Bf>h|pH5e3tLIog$PQ}v^dH5nw1Sz1IW|Oum0suk?2$+(K z5dsB}Fc&yd9BSr*5eIkvF8GB7PlSb%_Mf2mP)HcmwzF=7e8PO>u$TZ+1PP-E?)i-f z3QOCPDWnK8iK5^ZNc0b+L@GE^;uP={B1Q~E{ceE?3%EPD99JOwgpx2SpwfS@7XTzB zNZVE(cP5M&XZk18{<9q1EhU1{2lX%qLA?VwEO<&v1Pg+?+vh*!|K*#hfYLvy-Tr-G zRA2`LqymCaDgZ!OF9=ox4_JiasJnbAl6U6w_(CgBAxUB*BlR= zb_d$>KE+*;mKOeoP|x{f;PtGHn)<@TIUI5F>M^;kT!s^pYno9%J)-L7E-X4nQvE+K1bF5B29)&4;Xor{wBGLN%V>E4pT+3GjFVyuH<2FSz zG;VvgjD`fU(0}ROC>u3?S#Z~>TTCexia;^Nn~xxaRqKUkYu|}+%}YJG25M7VT#^aO zbau*PVX_Yj10Vpy5wr*8w^bo83YUbV{o)|zFg*GAjiUWa#JgHI1rJ)%{^&|x87>V< zp8wws!oTOm;Rp~00K9*4zAfi%&H)ICyQWSZ`?VX*HXD?vM)mb4@+#Ao+y%iWE@(nq z3Y|zV98f6El-qAVthlN^rxF%^fdAQ^Q9~7oZx|=zaeJ~b&Wnt$wmXsOQ|h;J(O>!4 zqc)-iQ#?OZYM8RVp+1`AW$@&&knAP@TSh_Gr}UQ>A2Z3J r^&c}fo@S_3Jam>i{P~RA5wR3!RMboEI}D@h?onUPV4XkoPWrzAKj#0O diff --git a/src/test/resources/server.truststore b/src/test/resources/server.truststore deleted file mode 100644 index 8d57af45b2d2c5ee09a2b8e0a01a50b3f3c2a7fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2142 zcmezO_TO6u1_mZL=1$JZOwB9NO-?N;VPIg4Sydgih=Dai&(y$@fr0tAK@;@|?5KvO7;8T)fC}bc2Qo_u`8R;Jyq>z`Gn`)?Hpai#`lTl1GwJf!$GATc$(gDoU z0~>B2C(dhVZeV6;YG7t;X=D&3&TC{~U;=~??x1vY6QdGx&@!?zFgG#sGZ-{6axpbA zGBRvD8|`*^>&9uun*CR|X~%4sH|?ZeXvmqnSsQ<(-OT3+vi7G>|Nv9$9qHre(;(x^w_UHhiTv3vD7lfzOt zt~`p~*D=wG@3Y5ZTle|es;y`3Lkd_UX820~o47cT?Y2Xkv$tpZ%n3@WQ(v%caEfN! zSg95NVt3rHu1T-gUaR`QQTo*O32qU4A22J&=;b(NvWb{;JZ#aknCNox@>vb@kClJ< zx;59v?s|}uwNYe;*|Iqg>@G}QA9zAYsg;RUV72geSGH``H9W6Z+!DI&G&}aTh5GY< zw^Qu}99}<>yP^19d!}}$@deN`t6l) zNd3=#`@quZM@>&=T;2b%mSb@=Pef?oak=*Cf94zdMJ8Ok)T(;CDO&Ww Date: Mon, 11 May 2020 22:55:26 +0200 Subject: [PATCH 03/58] Update parent pom version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 01d2534..28e68b0 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ io.vertx vertx-ext-parent - 34 + 35 vertx-tcp-eventbus-bridge From c3cae00f9e8f834649005c2ecae91fdd5e739d47 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 28 May 2020 10:58:46 +0200 Subject: [PATCH 04/58] Releasing 4.0.0-milestone5 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 28e68b0..8ce99c2 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0-SNAPSHOT + 4.0.0-milestone5 Vert.x TCP EventBus Bridge - 4.0.0-SNAPSHOT + 4.0.0-milestone5 From 81672a3a6c73842b65950a2e88210c67a5da7ed3 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 28 May 2020 11:00:50 +0200 Subject: [PATCH 05/58] Releasing 4.0.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8ce99c2..28e68b0 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0-milestone5 + 4.0.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.0.0-milestone5 + 4.0.0-SNAPSHOT From b618eeff327cc643894a1031e0987f328af77bc7 Mon Sep 17 00:00:00 2001 From: Razak Zakari Date: Thu, 28 May 2020 18:42:18 +0000 Subject: [PATCH 06/58] Security Update new Buffer(num) decprecated due to security issues, the new method Buffer.alloc(num) was introduced to fix the problem, an update was made to refix the security problem. --- src/client/nodejs/lib/tcp-vertx-eventbus.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/nodejs/lib/tcp-vertx-eventbus.js b/src/client/nodejs/lib/tcp-vertx-eventbus.js index e7cb3aa..9b8b4ff 100644 --- a/src/client/nodejs/lib/tcp-vertx-eventbus.js +++ b/src/client/nodejs/lib/tcp-vertx-eventbus.js @@ -47,7 +47,7 @@ function send(transport, message) { message = Buffer.from(message, "utf-8"); var msgLen = message.length; - var buffer = new Buffer(4); + var buffer = Buffer.alloc(4); buffer.writeInt32BE(msgLen, 0); transport.write(Buffer.concat([buffer, message], 4 + msgLen)); @@ -101,7 +101,7 @@ var EventBus = function (host, port, options) { this.onerror = console.error; // message buffer - var buffer = new Buffer(0); + var buffer = Buffer.alloc(0); var len = 0; this.transport.on('close', function () { From 374f375fb6f37f024a5872b6420a845c5f6297e2 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 23 Jul 2020 14:53:51 +0200 Subject: [PATCH 07/58] Releasing 4.0.0.Beta1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 28e68b0..ab40669 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0-SNAPSHOT + 4.0.0.Beta1 Vert.x TCP EventBus Bridge - 4.0.0-SNAPSHOT + 4.0.0.Beta1 From a8f1e6ed9fc1568766d8a202223e57ff644452af Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 23 Jul 2020 15:34:17 +0200 Subject: [PATCH 08/58] Releasing 4.0.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ab40669..28e68b0 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0.Beta1 + 4.0.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.0.0.Beta1 + 4.0.0-SNAPSHOT From 0a012fd3ec827c828fddd8f87be8dbc2df6ec3d5 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 20 Aug 2020 09:51:39 +0200 Subject: [PATCH 09/58] Update pom parent version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 28e68b0..fe0b92a 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ io.vertx vertx-ext-parent - 35 + 37 vertx-tcp-eventbus-bridge From b86c537a999e4a588c1b93882aa640faeef2f0fd Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Wed, 2 Sep 2020 10:03:37 +0200 Subject: [PATCH 10/58] Releasing 4.0.0.Beta2 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fe0b92a..4b2d3e3 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0-SNAPSHOT + 4.0.0.Beta2 Vert.x TCP EventBus Bridge - 4.0.0-SNAPSHOT + 4.0.0.Beta2 From 7e106f44b032caf5d922e4764dff93ff6c3ebda2 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Wed, 2 Sep 2020 10:34:32 +0200 Subject: [PATCH 11/58] Releasing 4.0.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 4b2d3e3..fe0b92a 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0.Beta2 + 4.0.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.0.0.Beta2 + 4.0.0-SNAPSHOT From d5e43f6ada525fe4108065d7d324dca6d26528fb Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 17 Sep 2020 16:05:57 +0200 Subject: [PATCH 12/58] Releasing 4.0.0.Beta3 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fe0b92a..398a65f 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0-SNAPSHOT + 4.0.0.Beta3 Vert.x TCP EventBus Bridge - 4.0.0-SNAPSHOT + 4.0.0.Beta3 From bb397d145b4995e88f978ceb90006b9fa7644636 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 17 Sep 2020 16:53:40 +0200 Subject: [PATCH 13/58] Releasing 4.0.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 398a65f..fe0b92a 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0.Beta3 + 4.0.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.0.0.Beta3 + 4.0.0-SNAPSHOT From c1ccb171736961c71b08e2b017ec87d04dcfca4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Oct 2020 08:31:41 +0000 Subject: [PATCH 14/58] Bump junit from 4.12 to 4.13.1 Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1. - [Release notes](https://github.com/junit-team/junit4/releases) - [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md) - [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fe0b92a..eadd8ff 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,7 @@ junit junit test - 4.12 + 4.13.1 io.vertx From 1112ebdd5e802f90dba83e17b43a60dd7375b656 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Sun, 1 Nov 2020 11:23:39 +0100 Subject: [PATCH 15/58] Releasing 4.0.0.CR1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index eadd8ff..4057a63 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0-SNAPSHOT + 4.0.0.CR1 Vert.x TCP EventBus Bridge - 4.0.0-SNAPSHOT + 4.0.0.CR1 From ffa579a93520c9ac51662cd169d17ce7a1a18ce1 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Sun, 1 Nov 2020 15:11:26 +0100 Subject: [PATCH 16/58] Releasing 4.0.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 4057a63..eadd8ff 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0.CR1 + 4.0.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.0.0.CR1 + 4.0.0-SNAPSHOT From d44b18f7d610804da96a8f80e86c2521f6956dcb Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 19 Nov 2020 09:35:55 +0100 Subject: [PATCH 17/58] GitHub action CI --- .github/workflows/ci.yml | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4022192 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +name: CI +on: + push: + branches: + - master + - '[0-9]+.[0-9]+' + pull_request: + branches: + - master + - '[0-9]+.[0-9]+' + schedule: + - cron: '0 4 * * *' +jobs: + Test: + name: Run tests + strategy: + matrix: + os: [ubuntu-latest] + jdk: [8, 11] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: maven-java-${{ matrix.jdk }} + - name: Checkout + uses: actions/checkout@v2 + - name: Install JDK + uses: joschi/setup-jdk@v2 + with: + java-version: ${{ matrix.jdk }} + - name: Run tests + run: mvn -q clean verify -B + - name: Publish Unit Test Results + uses: scacap/action-surefire-report@v1 + if: ${{ always() }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + Deploy: + name: Deploy to OSSRH + if: ${{ github.repository_owner == 'vert-x3' && github.event_name == 'push' }} + needs: Test + runs-on: ubuntu-latest + env: + SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + steps: + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: maven-java-${{ matrix.jdk }} + - name: Checkout + uses: actions/checkout@v2 + - name: Install JDK + uses: joschi/setup-jdk@v2 + with: + java-version: 8 + - name: Get project version + run: echo "PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -B | grep -v '\[')" >> $GITHUB_ENV + - name: Maven deploy + if: ${{ endsWith(env.PROJECT_VERSION, '-SNAPSHOT') }} + run: mvn deploy -s .travis.maven.settings.xml -DskipTests -B From 23b2d94dda499ca4ae3a5fd226bc8e58066b3591 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Mon, 23 Nov 2020 11:55:14 +0100 Subject: [PATCH 18/58] Releasing 4.0.0.CR2 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index eadd8ff..cb95f27 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0-SNAPSHOT + 4.0.0.CR2 Vert.x TCP EventBus Bridge - 4.0.0-SNAPSHOT + 4.0.0.CR2 From 43c9ce91ec97a62df8181de641b3c56014fd3c8a Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Mon, 23 Nov 2020 12:39:08 +0100 Subject: [PATCH 19/58] Releasing 4.0.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index cb95f27..eadd8ff 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0.CR2 + 4.0.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.0.0.CR2 + 4.0.0-SNAPSHOT From 9124d513f5aa5274dddc162d053621d435e70360 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Mon, 23 Nov 2020 17:29:38 +0100 Subject: [PATCH 20/58] Remove junit publish action that can't work with PR from forkeks --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4022192..239a372 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,11 +31,6 @@ jobs: java-version: ${{ matrix.jdk }} - name: Run tests run: mvn -q clean verify -B - - name: Publish Unit Test Results - uses: scacap/action-surefire-report@v1 - if: ${{ always() }} - with: - github_token: ${{ secrets.GITHUB_TOKEN }} Deploy: name: Deploy to OSSRH if: ${{ github.repository_owner == 'vert-x3' && github.event_name == 'push' }} From 88f5fa9c3e34506d58993719d58a9daf50ae2924 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Mon, 23 Nov 2020 17:38:21 +0100 Subject: [PATCH 21/58] Cleanup useless travis CI files --- .travis.deploy.artifacts.sh | 5 ----- .travis.yml | 31 ------------------------------- 2 files changed, 36 deletions(-) delete mode 100644 .travis.deploy.artifacts.sh delete mode 100644 .travis.yml diff --git a/.travis.deploy.artifacts.sh b/.travis.deploy.artifacts.sh deleted file mode 100644 index d6f9804..0000000 --- a/.travis.deploy.artifacts.sh +++ /dev/null @@ -1,5 +0,0 @@ -PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -B | grep -v '\[') -if [[ "$PROJECT_VERSION" =~ .*SNAPSHOT ]] && [[ "${TRAVIS_BRANCH}" =~ ^master$|^[0-9]+\.[0-9]+$ ]] && [[ "${TRAVIS_PULL_REQUEST}" = "false" ]]; -then - mvn deploy -s .travis.maven.settings.xml -DskipTests -B; -fi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 064d240..0000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: java -branches: - only: - - master - - /^\d+\.\d+$/ -cache: - directories: - - $HOME/.m2 -before_cache: - - rm -rf $HOME/.m2/repository/io/vertx/ -jobs: - include: - - stage: test - name: "OpenJDK 8" - jdk: openjdk8 - script: mvn -q clean verify -B - - if: type != pull_request - name: "OpenJDK 11" - jdk: openjdk11 - script: mvn -q clean verify -B - - stage: deploy - name: "Deploy to Sonatype's snapshots repository" - jdk: openjdk8 - if: type != pull_request AND env(SONATYPE_NEXUS_USERNAME) IS present - script: bash .travis.deploy.artifacts.sh -notifications: - email: - recipients: - - secure: "OFDvmbTbrfEnG9hBX/ekW6PXaM4bskrTayCr4umVM07HMU1YAKYkKfABwCf+6ccrA9MI/zXzeP8Pw5Pl8ARGA/Q2Eyv6C3o2bbXd5bk9aMa+kxE4Utv0pW6IMKH9BywR/eWfjYPKHs73fDzOC/u1h8xejFgIhddVgqCocVbb1cGmj6LwpP3YwjAOIoUbKnu4Ug7tOVD7r1laEL06g6kcUDMx1Me5I10rlx2n9kzn134esImP+dacgP9Pa0TjCqgxcjn0GYpi+txoLb3+4koEHcCm3isNdmaDJMRrQ38JlXTJ+EfG3ZykNKDaJMDE2iNqyvpwx1nn9TZWwcMF32UBlpH0ADzoLY93KGkpfSdaBkXCon1gyPiKIpgC6+HviO7K6dZnm2rUyfFrWEvGwb2l93m+La1WEIRucBWBxzw63ypvIv5qFDonWgvm6Byk9OUsPu1dF8zMKSjBAiDcqvefpXupZ+sAEIHOLio0XBYpBaSvrakjoL4gEv+TJiY4VhYfovbt3qEy47ov9ejtK9RevYcmY4/pTo9sfqIsi7oKJd8hEJT3Z7djHZ2MifgI9zrXMdLqbHogM30aIQ9y8RduIVEdbX39WogDPFH3F8y3b3kXHXaNA8K5+d/WYhE9Bq9QbHSk7vAu2sa1Jz2jk0nX4vAesNfwp2WMcelvqy/er1o=" - on_success: always - on_failure: always From 7ba85c4b0aa21c7e8bf19d397b26460e2b22c282 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Mon, 23 Nov 2020 18:49:12 +0100 Subject: [PATCH 22/58] Update CI badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e92963..cac8458 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # vertx-tcp-eventbus-bridge -[![Build Status](https://travis-ci.org/vert-x3/vertx-tcp-eventbus-bridge.svg?branch=master)](https://travis-ci.org/vert-x3/vertx-tcp-eventbus-bridge) +[![Build Status](https://github.com/vert-x3/vertx-tcm-eventbus-bridge/workflows/CI/badge.svg?branch=master)](https://github.com/vert-x3/vertx-tcp-eventbus-bridge/actions?query=workflow%3ACI) This is a TCP eventbus bridge implementation. From 26b81caa9daa0361af88ae5cb45a91b0b5263f8d Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Wed, 2 Dec 2020 14:07:45 +0100 Subject: [PATCH 23/58] Remove Maven repository caching from CI action --- .github/workflows/ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 239a372..7a5f399 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,10 +19,6 @@ jobs: jdk: [8, 11] runs-on: ${{ matrix.os }} steps: - - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: maven-java-${{ matrix.jdk }} - name: Checkout uses: actions/checkout@v2 - name: Install JDK @@ -40,10 +36,6 @@ jobs: SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} steps: - - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: maven-java-${{ matrix.jdk }} - name: Checkout uses: actions/checkout@v2 - name: Install JDK From 401c31fe4d9e08b14823356cd56c995cdac46f65 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Wed, 2 Dec 2020 18:25:35 +0100 Subject: [PATCH 24/58] Deploy SNAPSHOT on cron GitHub events --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a5f399..d70a275 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: run: mvn -q clean verify -B Deploy: name: Deploy to OSSRH - if: ${{ github.repository_owner == 'vert-x3' && github.event_name == 'push' }} + if: ${{ github.repository_owner == 'vert-x3' && (github.event_name == 'push' || github.event_name == 'schedule') }} needs: Test runs-on: ubuntu-latest env: From 0356e1e6ba88f3ec2866999a1d78724ebcb8be6f Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Sun, 6 Dec 2020 17:51:58 +0100 Subject: [PATCH 25/58] Fix missing future methods --- .../bridge/tcp/TcpEventBusBridge.java | 20 +++++++++---------- .../tcp/impl/TcpEventBusBridgeImpl.java | 19 ++++++++---------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/main/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridge.java b/src/main/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridge.java index e87bbfa..5abbdda 100644 --- a/src/main/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridge.java +++ b/src/main/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridge.java @@ -18,6 +18,7 @@ import io.vertx.codegen.annotations.Fluent; import io.vertx.codegen.annotations.VertxGen; import io.vertx.core.AsyncResult; +import io.vertx.core.Future; import io.vertx.core.Handler; import io.vertx.core.Vertx; import io.vertx.core.net.NetServerOptions; @@ -49,10 +50,9 @@ static TcpEventBusBridge create(Vertx vertx, BridgeOptions options, NetServerOpt /** * Listen on default port 7000 * - * @return self + * @return a future of the result */ - @Fluent - TcpEventBusBridge listen(); + Future listen(); /** * Listen on default port 7000 with a handler to report the state of the socket listen operation. @@ -69,10 +69,9 @@ static TcpEventBusBridge create(Vertx vertx, BridgeOptions options, NetServerOpt * @param port tcp port * @param address tcp address to the bind * - * @return self + * @return a future of the result */ - @Fluent - TcpEventBusBridge listen(int port, String address); + Future listen(int port, String address); /** * Listen on specific port and bind to specific address @@ -91,10 +90,9 @@ static TcpEventBusBridge create(Vertx vertx, BridgeOptions options, NetServerOpt * * @param port tcp port * - * @return self + * @return a future of the result */ - @Fluent - TcpEventBusBridge listen(int port); + Future listen(int port); /** * Listen on specific port @@ -116,6 +114,8 @@ static TcpEventBusBridge create(Vertx vertx, BridgeOptions options, NetServerOpt /** * Close the current socket. + * + * @return a future of the result */ - void close(); + Future close(); } diff --git a/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/TcpEventBusBridgeImpl.java b/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/TcpEventBusBridgeImpl.java index 9ec01d3..ab2e613 100644 --- a/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/TcpEventBusBridgeImpl.java +++ b/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/TcpEventBusBridgeImpl.java @@ -77,21 +77,18 @@ public TcpEventBusBridgeImpl(Vertx vertx, BridgeOptions options, NetServerOption @Override - public TcpEventBusBridge listen() { - server.listen(); - return this; + public Future listen() { + return server.listen().map(this); } @Override - public TcpEventBusBridge listen(int port) { - server.listen(port); - return this; + public Future listen(int port) { + return server.listen(port).map(this); } @Override - public TcpEventBusBridge listen(int port, String address) { - server.listen(port, address); - return this; + public Future listen(int port, String address) { + return server.listen(port, address).map(this); } @Override @@ -293,8 +290,8 @@ public void close(Handler> handler) { } @Override - public void close() { - server.close(); + public Future close() { + return server.close(); } private void checkCallHook(Supplier eventSupplier, Runnable okAction, Runnable rejectAction) { From 7fe23026d07091dfb1cd7c05c5af6ebe53c25377 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Mon, 7 Dec 2020 14:23:04 +0100 Subject: [PATCH 26/58] Releasing 4.0.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index eadd8ff..36099d9 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0-SNAPSHOT + 4.0.0 Vert.x TCP EventBus Bridge - 4.0.0-SNAPSHOT + 4.0.0 From 98b3dcc13edf37126485fa58fd2460139465058f Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Mon, 7 Dec 2020 17:15:47 +0100 Subject: [PATCH 27/58] Releasing 4.0.1-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 36099d9..eeb5907 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.0 + 4.0.1-SNAPSHOT Vert.x TCP EventBus Bridge - 4.0.0 + 4.0.1-SNAPSHOT From 90b3d8d9b8a829b0e4f091b691a755c5c65885c6 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Wed, 3 Feb 2021 10:41:08 +0100 Subject: [PATCH 28/58] Releasing 4.0.1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index eeb5907..365fbde 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.1-SNAPSHOT + 4.0.1 Vert.x TCP EventBus Bridge - 4.0.1-SNAPSHOT + 4.0.1 From e5fd43c20e253959c322a4148f5dd8fc5c4bd2f1 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Wed, 3 Feb 2021 11:42:15 +0100 Subject: [PATCH 29/58] Releasing 4.0.2-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 365fbde..0d61b06 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.1 + 4.0.2-SNAPSHOT Vert.x TCP EventBus Bridge - 4.0.1 + 4.0.2-SNAPSHOT From 9f73aea4a5a2cb3f95816882dadbbbdb3a6fb785 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Fri, 5 Feb 2021 08:49:49 +0100 Subject: [PATCH 30/58] Releasing 4.0.2 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0d61b06..af9b860 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.2-SNAPSHOT + 4.0.2 Vert.x TCP EventBus Bridge - 4.0.2-SNAPSHOT + 4.0.2 From d0b984cf01812b70e787cc18261672fded5d5654 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Fri, 5 Feb 2021 09:47:47 +0100 Subject: [PATCH 31/58] Releasing 4.0.3-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index af9b860..c5e45bc 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.2 + 4.0.3-SNAPSHOT Vert.x TCP EventBus Bridge - 4.0.2 + 4.0.3-SNAPSHOT From f20bb2bfcec4a6540d84e721df69815e9cef97d0 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Wed, 17 Feb 2021 11:34:29 +0100 Subject: [PATCH 32/58] Configure new distribution infrastructure --- .github/workflows/ci.yml | 4 ++-- .travis.maven.settings.xml | 6 +++--- pom.xml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d70a275..875a7bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,8 +33,8 @@ jobs: needs: Test runs-on: ubuntu-latest env: - SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} - SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + VERTX_NEXUS_USERNAME: ${{ secrets.VERTX_NEXUS_USERNAME }} + VERTX_NEXUS_PASSWORD: ${{ secrets.VERTX_NEXUS_PASSWORD }} steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.travis.maven.settings.xml b/.travis.maven.settings.xml index cd8c444..4561e31 100644 --- a/.travis.maven.settings.xml +++ b/.travis.maven.settings.xml @@ -7,9 +7,9 @@ - sonatype-nexus-snapshots - ${env.SONATYPE_NEXUS_USERNAME} - ${env.SONATYPE_NEXUS_PASSWORD} + vertx-snapshots-repository + ${env.VERTX_NEXUS_USERNAME} + ${env.VERTX_NEXUS_PASSWORD} diff --git a/pom.xml b/pom.xml index c5e45bc..2e9de8f 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ io.vertx vertx-ext-parent - 37 + 38 vertx-tcp-eventbus-bridge From 912748da8af85361af7ccccfffd52a1035a32b0f Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Fri, 12 Mar 2021 15:46:57 +0100 Subject: [PATCH 33/58] Releasing 4.0.3 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2e9de8f..6617cfc 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.3-SNAPSHOT + 4.0.3 Vert.x TCP EventBus Bridge - 4.0.3-SNAPSHOT + 4.0.3 From 1a1cebdf7f026723e79c989986836a8ce41500c1 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Fri, 12 Mar 2021 16:16:41 +0100 Subject: [PATCH 34/58] Releasing 4.0.4-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 6617cfc..e00978b 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.3 + 4.0.4-SNAPSHOT Vert.x TCP EventBus Bridge - 4.0.3 + 4.0.4-SNAPSHOT From dc29fdbcf3d1a0518c7989ab6a40e6cea2463a32 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 30 Mar 2021 10:36:20 +0200 Subject: [PATCH 35/58] Set version to 4.1.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e00978b..f9c566d 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.0.4-SNAPSHOT + 4.1.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.0.4-SNAPSHOT + 4.1.0-SNAPSHOT From b3fd5a2b12cd9d3e794f28b0d20f28f31b2210a4 Mon Sep 17 00:00:00 2001 From: Lin Gao Date: Tue, 13 Apr 2021 11:04:48 +0800 Subject: [PATCH 36/58] Fix build status link in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cac8458..1a18cd4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # vertx-tcp-eventbus-bridge -[![Build Status](https://github.com/vert-x3/vertx-tcm-eventbus-bridge/workflows/CI/badge.svg?branch=master)](https://github.com/vert-x3/vertx-tcp-eventbus-bridge/actions?query=workflow%3ACI) +[![Build Status](https://github.com/vert-x3/vertx-tcp-eventbus-bridge/workflows/CI/badge.svg?branch=master)](https://github.com/vert-x3/vertx-tcp-eventbus-bridge/actions?query=workflow%3ACI) This is a TCP eventbus bridge implementation. From 3134db7f9ba14a4f1283472bc5b148fd3d321632 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Fri, 7 May 2021 15:32:02 +0200 Subject: [PATCH 37/58] Releasing 4.1.0.Beta1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f9c566d..49dc331 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.1.0-SNAPSHOT + 4.1.0.Beta1 Vert.x TCP EventBus Bridge - 4.1.0-SNAPSHOT + 4.1.0.Beta1 From ff456518200175d4fa0fe7dc26fa58868fcc4bbe Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Fri, 7 May 2021 15:34:07 +0200 Subject: [PATCH 38/58] Releasing 4.1.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 49dc331..f9c566d 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.1.0.Beta1 + 4.1.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.1.0.Beta1 + 4.1.0-SNAPSHOT From 02a6cc8f7c4edac6f15132fe05ebffd194bd8f24 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 20 May 2021 15:44:06 +0200 Subject: [PATCH 39/58] Releasing 4.1.0.CR1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f9c566d..d614a90 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.1.0-SNAPSHOT + 4.1.0.CR1 Vert.x TCP EventBus Bridge - 4.1.0-SNAPSHOT + 4.1.0.CR1 From d1a181a640046465b4551477813b3748ddd1efc2 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 20 May 2021 16:11:10 +0200 Subject: [PATCH 40/58] Releasing 4.1.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d614a90..f9c566d 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.1.0.CR1 + 4.1.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.1.0.CR1 + 4.1.0-SNAPSHOT From ab18ea31719526376a8fbaaecbf9aefb33b128b7 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 27 May 2021 15:26:59 +0200 Subject: [PATCH 41/58] Releasing 4.1.0.CR2 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f9c566d..bba7319 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.1.0-SNAPSHOT + 4.1.0.CR2 Vert.x TCP EventBus Bridge - 4.1.0-SNAPSHOT + 4.1.0.CR2 From 176b6fba702457aad746ac4dd273b524c00f84eb Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 27 May 2021 15:49:14 +0200 Subject: [PATCH 42/58] Releasing 4.1.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index bba7319..f9c566d 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.1.0.CR2 + 4.1.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.1.0.CR2 + 4.1.0-SNAPSHOT From b9dae4758e069991010ed8add43c10c8f94b3257 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 1 Jun 2021 15:37:15 +0200 Subject: [PATCH 43/58] Releasing 4.1.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f9c566d..23cb62c 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.1.0-SNAPSHOT + 4.1.0 Vert.x TCP EventBus Bridge - 4.1.0-SNAPSHOT + 4.1.0 From 92f7b99cd82447fc767a71692914c94a000208bc Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 1 Jun 2021 15:59:19 +0200 Subject: [PATCH 44/58] Releasing 4.1.1-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 23cb62c..c253d25 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.1.0 + 4.1.1-SNAPSHOT Vert.x TCP EventBus Bridge - 4.1.0 + 4.1.1-SNAPSHOT From 4145e8fb2659d6b234ed0e67c6c81b7e827ce8e2 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 1 Jul 2021 11:38:19 +0200 Subject: [PATCH 45/58] Releasing 4.1.1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c253d25..d5e4a97 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.1.1-SNAPSHOT + 4.1.1 Vert.x TCP EventBus Bridge - 4.1.1-SNAPSHOT + 4.1.1 From 7338b74f9e09bc062db1660cb0d61ff230735063 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 1 Jul 2021 12:06:17 +0200 Subject: [PATCH 46/58] Set version to 4.2.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d5e4a97..908e0b6 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.1.1 + 4.2.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.1.1 + 4.2.0-SNAPSHOT From a0f02805730e84c3cd06485ec452551c76d39255 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 10 Aug 2021 09:24:14 +0200 Subject: [PATCH 47/58] true --- .github/workflows/ci.yml | 4 ++-- .travis.maven.settings.xml | 17 ----------------- 2 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 .travis.maven.settings.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 875a7bc..2184f2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: with: java-version: ${{ matrix.jdk }} - name: Run tests - run: mvn -q clean verify -B + run: mvn -s .github/maven-ci-settings.xml -q clean verify -B Deploy: name: Deploy to OSSRH if: ${{ github.repository_owner == 'vert-x3' && (github.event_name == 'push' || github.event_name == 'schedule') }} @@ -46,4 +46,4 @@ jobs: run: echo "PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -B | grep -v '\[')" >> $GITHUB_ENV - name: Maven deploy if: ${{ endsWith(env.PROJECT_VERSION, '-SNAPSHOT') }} - run: mvn deploy -s .travis.maven.settings.xml -DskipTests -B + run: mvn deploy -s .github/maven-cd-settings.xml -DskipTests -B diff --git a/.travis.maven.settings.xml b/.travis.maven.settings.xml deleted file mode 100644 index 4561e31..0000000 --- a/.travis.maven.settings.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - false - - - - vertx-snapshots-repository - ${env.VERTX_NEXUS_USERNAME} - ${env.VERTX_NEXUS_PASSWORD} - - - - - From d70f774c43e400eaa9eae1fc03faf575031282ab Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 10 Aug 2021 09:30:57 +0200 Subject: [PATCH 48/58] Update CI/CD actions --- .github/maven-cd-settings.xml | 63 +++++++++++++++++++++++++++++++++++ .github/maven-ci-settings.xml | 55 ++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 .github/maven-cd-settings.xml create mode 100644 .github/maven-ci-settings.xml diff --git a/.github/maven-cd-settings.xml b/.github/maven-cd-settings.xml new file mode 100644 index 0000000..1ee3124 --- /dev/null +++ b/.github/maven-cd-settings.xml @@ -0,0 +1,63 @@ + + + + + false + + + + vertx-snapshots-repository + ${env.VERTX_NEXUS_USERNAME} + ${env.VERTX_NEXUS_PASSWORD} + + + + + + google-mirror + + true + + + + google-maven-central + GCS Maven Central mirror EU + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + + google-maven-central + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + + diff --git a/.github/maven-ci-settings.xml b/.github/maven-ci-settings.xml new file mode 100644 index 0000000..24b5bdb --- /dev/null +++ b/.github/maven-ci-settings.xml @@ -0,0 +1,55 @@ + + + + + false + + + + google-mirror + + true + + + + google-maven-central + GCS Maven Central mirror EU + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + + google-maven-central + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + + From 28dffccea01bff7561baf16469a2fb2207c501c4 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 24 Aug 2021 14:32:54 +0200 Subject: [PATCH 49/58] Releasing 4.2.0.Beta1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 908e0b6..a192629 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.2.0-SNAPSHOT + 4.2.0.Beta1 Vert.x TCP EventBus Bridge - 4.2.0-SNAPSHOT + 4.2.0.Beta1 From dc18cb177d41db86b1f8132279948850d2b6364d Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 24 Aug 2021 14:55:07 +0200 Subject: [PATCH 50/58] Back to snapshots --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a192629..908e0b6 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.2.0.Beta1 + 4.2.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.2.0.Beta1 + 4.2.0-SNAPSHOT From fdc47bdc512f7afe3da9841ef3b7627ea9c444a3 Mon Sep 17 00:00:00 2001 From: Paulo Lopes Date: Fri, 3 Sep 2021 13:01:14 +0200 Subject: [PATCH 51/58] Fix #61: message body should not be locked to JSON Object Signed-off-by: Paulo Lopes --- README.md | 4 +- .../tcp/impl/TcpEventBusBridgeImpl.java | 21 +++----- .../bridge/tcp/impl/protocol/FrameHelper.java | 6 +-- .../bridge/tcp/TcpEventBusBridgeTest.java | 54 +++++++++++++++++++ 4 files changed, 67 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 1a18cd4..a662394 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ It is the response to the `ping` request from client to bridge. For a regular message, the object will also contain: * `address`: (string, required) Destination address. -* `body`: (object, required) Message content as a JSON object. +* `body`: (any, required) Message content as a JSON valid type. * `headers`: (object, optional) Headers as a JSON object with String values. * `replyAddress`: (string, optional) Address for replying to. * `send`: (boolean, required) Will be `true` if the message is a send, `false` if a publish. @@ -54,7 +54,7 @@ type is shown below, along with the companion keys for that type: #### `type: "send"`, `type: "publish"` * `address`: (string, required) Destination address -* `body`: (object, required) Message content as a JSON object. +* `body`: (any, required) Message content as a JSON valid type. * `headers`: (object, optional) Headers as a JSON object with String values. * `replyAddress`: (string, optional) Address for replying to. diff --git a/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/TcpEventBusBridgeImpl.java b/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/TcpEventBusBridgeImpl.java index ab2e613..ff2b111 100644 --- a/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/TcpEventBusBridgeImpl.java +++ b/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/TcpEventBusBridgeImpl.java @@ -71,11 +71,6 @@ public TcpEventBusBridgeImpl(Vertx vertx, BridgeOptions options, NetServerOption server.connectHandler(this::handler); } - public TcpEventBusBridgeImpl(Vertx vertx, BridgeOptions options, NetServerOptions netServerOptions) { - this(vertx, options, netServerOptions, null); - } - - @Override public Future listen() { return server.listen().map(this); @@ -128,8 +123,8 @@ public TcpEventBusBridge listen(int port, Handler } private void doSendOrPub(NetSocket socket, String address, JsonObject msg, Map> registry, Map> replies) { - final JsonObject body = msg.getJsonObject("body"); + MessageConsumer> registry, Map> replies) { + final Object body = msg.getValue("body"); final JsonObject headers = msg.getJsonObject("headers"); @@ -144,11 +139,11 @@ private void doSendOrPub(NetSocket socket, String address, JsonObject msg, Map> res1) -> { + eb.request(address, body, deliveryOptions, (AsyncResult> res1) -> { if (res1.failed()) { sendErrFrame(address, replyAddress, (ReplyException) res1.cause(), socket); } else { - final Message response = res1.result(); + final Message response = res1.result(); final JsonObject responseHeaders = new JsonObject(); // clone the headers from / to @@ -195,7 +190,7 @@ private void doSendOrPub(NetSocket socket, String address, JsonObject msg, Map res1) -> { + registry.put(address, eb.consumer(address, (Message res1) -> { // save a reference to the message so tcp bridged messages can be replied properly if (res1.replyAddress() != null) { replies.put(res1.replyAddress(), res1); @@ -239,7 +234,7 @@ private void doSendOrPub(NetSocket socket, String address, JsonObject msg, Map> registry = new ConcurrentHashMap<>(); - final Map> replies = new ConcurrentHashMap<>(); + final Map> replies = new ConcurrentHashMap<>(); // create a protocol parser final FrameParser parser = new FrameParser(res -> { @@ -261,7 +256,7 @@ private void handler(NetSocket socket) { () -> { if (eventType != BridgeEventType.SOCKET_PING && address == null) { sendErrFrame("missing_address", socket); - log.error("msg does not have address: " + msg.toString()); + log.error("msg does not have address: " + msg); return; } doSendOrPub(socket, address, msg, registry, replies); @@ -326,7 +321,7 @@ private boolean checkMatches(boolean inbound, String address) { return checkMatches(inbound, address, null); } - private boolean checkMatches(boolean inbound, String address, Map> replies) { + private boolean checkMatches(boolean inbound, String address, Map> replies) { // special case, when dealing with replies the addresses are not in the inbound/outbound list but on // the replies registry if (replies != null && inbound && replies.containsKey(address)) { diff --git a/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/protocol/FrameHelper.java b/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/protocol/FrameHelper.java index 1376944..e07a38e 100644 --- a/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/protocol/FrameHelper.java +++ b/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/protocol/FrameHelper.java @@ -33,7 +33,7 @@ public class FrameHelper { private FrameHelper() {} - public static void sendFrame(String type, String address, String replyAddress, JsonObject headers, Boolean send, JsonObject body, WriteStream handler) { + public static void sendFrame(String type, String address, String replyAddress, JsonObject headers, Boolean send, Object body, WriteStream handler) { final JsonObject payload = new JsonObject().put("type", type); if (address != null) { @@ -59,11 +59,11 @@ public static void sendFrame(String type, String address, String replyAddress, J writeFrame(payload, handler); } - public static void sendFrame(String type, String address, String replyAddress, JsonObject body, WriteStream handler) { + public static void sendFrame(String type, String address, String replyAddress, Object body, WriteStream handler) { sendFrame(type, address, replyAddress, null, null, body, handler); } - public static void sendFrame(String type, String address, JsonObject body, WriteStream handler) { + public static void sendFrame(String type, String address, Object body, WriteStream handler) { sendFrame(type, address, null, null, null, body, handler); } diff --git a/src/test/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridgeTest.java b/src/test/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridgeTest.java index 82ad559..7ef6404 100644 --- a/src/test/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridgeTest.java +++ b/src/test/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridgeTest.java @@ -91,6 +91,24 @@ public void testSendVoidMessage(TestContext context) { })); } + @Test + public void testSendVoidStringMessage(TestContext context) { + // Send a request and get a response + NetClient client = vertx.createNetClient(); + final Async async = context.async(); + + vertx.eventBus().consumer("test", (Message msg) -> { + context.assertTrue(msg.body() instanceof String); + context.assertEquals("I'm not a JSON Object", msg.body()); + client.close(); + async.complete(); + }); + + client.connect(7000, "localhost", context.asyncAssertSuccess(socket -> { + FrameHelper.sendFrame("send", "test", "I'm not a JSON Object", socket); + })); + } + @Test public void testNoHandlers(TestContext context) { // Send a request and get a response @@ -359,6 +377,42 @@ public void testReplyFromClient(TestContext context) { } + @Test + public void testReplyStringMessageFromClient(TestContext context) { + // Send a request from java and get a response from the client + NetClient client = vertx.createNetClient(); + final Async async = context.async(); + final String address = "test"; + client.connect(7000, "localhost", context.asyncAssertSuccess(socket -> { + + final FrameParser parser = new FrameParser(parse -> { + context.assertTrue(parse.succeeded()); + JsonObject frame = parse.result(); + if ("message".equals(frame.getString("type"))) { + context.assertEquals(true, frame.getBoolean("send")); + context.assertEquals("Vert.x", frame.getJsonObject("body").getString("value")); + FrameHelper.sendFrame("send", frame.getString("replyAddress"), "You got it", socket); + } + }); + + socket.handler(parser); + + FrameHelper.sendFrame("register", address, null, socket); + + // There is now way to know that the register actually happened, wait a bit before sending. + vertx.setTimer( 500L, timerId -> { + vertx.eventBus().request(address, new JsonObject().put("value", "Vert.x"), respMessage -> { + context.assertTrue(respMessage.succeeded()); + context.assertEquals("You got it", respMessage.result().body()); + client.close(); + async.complete(); + }); + }); + + })); + + } + @Test public void testFailFromClient(TestContext context) { // Send a request from java and get a response from the client From 25dd4ffcdbc1e80f990762b9c0e57982d6cece02 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 23 Sep 2021 09:45:58 +0200 Subject: [PATCH 52/58] Update CI to run with JDK 17 instead of JDK 11 --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2184f2d..a08d993 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,15 +16,16 @@ jobs: strategy: matrix: os: [ubuntu-latest] - jdk: [8, 11] + jdk: [8, 17] runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v2 - name: Install JDK - uses: joschi/setup-jdk@v2 + uses: actions/setup-java@v2 with: java-version: ${{ matrix.jdk }} + distribution: temurin - name: Run tests run: mvn -s .github/maven-ci-settings.xml -q clean verify -B Deploy: @@ -39,9 +40,10 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Install JDK - uses: joschi/setup-jdk@v2 + uses: actions/setup-java@v2 with: java-version: 8 + distribution: temurin - name: Get project version run: echo "PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -B | grep -v '\[')" >> $GITHUB_ENV - name: Maven deploy From 7e3e3ec638b1f2338c57461062fd7eb29345f266 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 23 Sep 2021 16:22:53 +0200 Subject: [PATCH 53/58] Adapt to Java 17 --- .../eventbus/bridge/tcp/TcpEventBusBridgeEventTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridgeEventTest.java b/src/test/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridgeEventTest.java index 60037fa..175c3e8 100644 --- a/src/test/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridgeEventTest.java +++ b/src/test/java/io/vertx/ext/eventbus/bridge/tcp/TcpEventBusBridgeEventTest.java @@ -34,7 +34,8 @@ import org.junit.runner.RunWith; import javax.net.ssl.SSLPeerUnverifiedException; -import javax.security.cert.X509Certificate; +import java.security.cert.Certificate; +import java.security.cert.X509Certificate; @RunWith(VertxUnitRunner.class) public class TcpEventBusBridgeEventTest { @@ -70,8 +71,8 @@ public void before(TestContext context) { logger.info("Handled a bridge event " + be.getRawMessage()); if (be.socket().isSsl()) { try { - for (X509Certificate c : be.socket().peerCertificateChain()) { - logger.info(c.getSubjectDN().toString()); + for (Certificate c : be.socket().peerCertificates()) { + logger.info(((X509Certificate)c).getSubjectDN().toString()); } } catch (SSLPeerUnverifiedException e) { throw new RuntimeException("Failed to get peer certificates chain", e); From 9b36ae44cdffa8c8772d768742dfb413ece79e11 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 19 Oct 2021 14:15:27 +0200 Subject: [PATCH 54/58] Releasing 4.2.0.CR1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 908e0b6..1fd5fe9 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.2.0-SNAPSHOT + 4.2.0.CR1 Vert.x TCP EventBus Bridge - 4.2.0-SNAPSHOT + 4.2.0.CR1 From 8362bf6f7037ec5c87d0c13b0b417ccc8deaecb0 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 19 Oct 2021 14:36:27 +0200 Subject: [PATCH 55/58] Releasing 4.2.0-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1fd5fe9..908e0b6 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.2.0.CR1 + 4.2.0-SNAPSHOT Vert.x TCP EventBus Bridge - 4.2.0.CR1 + 4.2.0-SNAPSHOT From b9ba31b4af8f34c0fd60d6ce564e756c9218feca Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 28 Oct 2021 09:11:59 +0200 Subject: [PATCH 56/58] Releasing 4.2.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 908e0b6..0836155 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.2.0-SNAPSHOT + 4.2.0 Vert.x TCP EventBus Bridge - 4.2.0-SNAPSHOT + 4.2.0 From 0020b273990a9e4ad11ae2303c1949092bea908a Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 28 Oct 2021 09:52:42 +0200 Subject: [PATCH 57/58] Releasing 4.2.1-SNAPSHOT --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0836155..2f2718f 100644 --- a/pom.xml +++ b/pom.xml @@ -24,12 +24,12 @@ vertx-tcp-eventbus-bridge - 4.2.0 + 4.2.1-SNAPSHOT Vert.x TCP EventBus Bridge - 4.2.0 + 4.2.1-SNAPSHOT From faf0fd7593bfdf112342fa326e8a72d0859bf8f3 Mon Sep 17 00:00:00 2001 From: nbrendah Date: Fri, 29 Oct 2021 02:36:46 +0300 Subject: [PATCH 58/58] Jsonrcp-WIP: Initialised client sending message not expecting a response test --- .../jsonrcp/JsonRPCIntegrationTest.java | 138 ++++++++++++++++++ .../tcp/JsonRPCStreamEventBusBridgeTest.java | 8 + 2 files changed, 146 insertions(+) create mode 100644 src/test/java/io/vertx/ext/eventbus/bridge/jsonrcp/JsonRPCIntegrationTest.java diff --git a/src/test/java/io/vertx/ext/eventbus/bridge/jsonrcp/JsonRPCIntegrationTest.java b/src/test/java/io/vertx/ext/eventbus/bridge/jsonrcp/JsonRPCIntegrationTest.java new file mode 100644 index 0000000..f6dad7f --- /dev/null +++ b/src/test/java/io/vertx/ext/eventbus/bridge/jsonrcp/JsonRPCIntegrationTest.java @@ -0,0 +1,138 @@ +/* + * Copyright 2015 Red Hat, Inc. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and Apache License v2.0 which accompanies this distribution. + * + * The Eclipse Public License is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * The Apache License v2.0 is available at + * http://www.opensource.org/licenses/apache2.0.php + * + * You may elect to redistribute this code under either of these licenses. + */ +package io.vertx.ext.eventbus.bridge.jsonrcp; + +import io.vertx.core.Handler; +import io.vertx.core.Vertx; +import io.vertx.core.eventbus.Message; +import io.vertx.core.json.JsonObject; +import io.vertx.core.net.NetClient; +import io.vertx.ext.bridge.BridgeOptions; +import io.vertx.ext.bridge.PermittedOptions; +import io.vertx.ext.eventbus.bridge.tcp.BridgeEvent; +import io.vertx.ext.eventbus.bridge.tcp.JsonRPCStreamEventBusBridge; +import io.vertx.ext.eventbus.bridge.tcp.impl.StreamParser; +import io.vertx.ext.unit.Async; +import io.vertx.ext.unit.TestContext; +import io.vertx.ext.unit.junit.RunTestOnContext; +import io.vertx.ext.unit.junit.VertxUnitRunner; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import java.util.UUID; + +import static io.vertx.ext.eventbus.bridge.tcp.impl.protocol.JsonRPCHelper.request; + +@RunWith(VertxUnitRunner.class) +public class JsonRPCIntegrationTest { + + String id() { + return UUID.randomUUID().toString(); + } + + @Rule + public RunTestOnContext rule = new RunTestOnContext(); + + private volatile Handler eventHandler = event -> event.complete(true); + + @Before + public void before(TestContext should) { + final Async test = should.async(); + final Vertx vertx = rule.vertx(); + + vertx.eventBus().consumer("hello", (Message msg) -> msg.reply(new JsonObject().put("value", "Hello " + msg.body().getString("value")))); + + vertx.eventBus().consumer("echo", (Message msg) -> msg.reply(msg.body())); + + vertx.setPeriodic(1000, __ -> vertx.eventBus().send("ping", new JsonObject().put("value", "hi"))); + + vertx.createNetServer() + .connectHandler(JsonRPCStreamEventBusBridge.create( + vertx, + new BridgeOptions() + .addInboundPermitted(new PermittedOptions().setAddress("hello")) + .addInboundPermitted(new PermittedOptions().setAddress("echo")) + .addInboundPermitted(new PermittedOptions().setAddress("test")) + .addOutboundPermitted(new PermittedOptions().setAddress("echo")) + .addOutboundPermitted(new PermittedOptions().setAddress("test")) + .addOutboundPermitted(new PermittedOptions().setAddress("ping")), + event -> eventHandler.handle(event))) + .listen(7000, res -> { + should.assertTrue(res.succeeded()); + test.complete(); + }); + } + + // client send message not expecting a response + @Test + public void testClientSendMessageNotExpectingResponse(TestContext context) { + final Vertx vertx = rule.vertx(); + NetClient client = vertx.createNetClient(); + final Async test = context.async(); + final String address = "test"; + + client.connect(7000, "localhost", context.asyncAssertSuccess(socket -> { + final StreamParser parser = new StreamParser() + .exceptionHandler(context::fail) + .handler((mineType, body) ->{ + + JsonObject frame = new JsonObject(body); + + if ("message".equals(frame.getString("send"))) { + context.assertEquals(true, frame.getBoolean("send")); + context.assertEquals("Vert.x", frame.getJsonObject("body").getString("value")); + + request( + "send", + "#backtrack", + new JsonObject() + .put("address", frame.getString("replyAddress")) + .put("body", new JsonObject().put("value", "You got it")), + socket); + } + }); + + + socket.handler(parser); + + request( + "register", + "#backtrack", + new JsonObject() + .put("address", address), + socket); + + // There is now way to know that the register actually happened, wait a bit before sending. + vertx.setTimer(500L, timerId -> { + vertx.eventBus().request(address, new JsonObject().put("value", "Vert.x"), respMessage -> { + context.assertTrue(respMessage.failed()); + client.close(); + test.complete(); + }); + }); + })); + } + + // client sends a message expecting a response + // client subscribes to a channel, server sends a reply + // client subscribes to a channel, server publishes a reply + // client subscribes to a channel, server sends multiple replies' + // client unsubscribes a channel, server sends a message, and it is not received on the client + // client send ping and expect pong + +} diff --git a/src/test/java/io/vertx/ext/eventbus/bridge/tcp/JsonRPCStreamEventBusBridgeTest.java b/src/test/java/io/vertx/ext/eventbus/bridge/tcp/JsonRPCStreamEventBusBridgeTest.java index b2edc67..109e421 100644 --- a/src/test/java/io/vertx/ext/eventbus/bridge/tcp/JsonRPCStreamEventBusBridgeTest.java +++ b/src/test/java/io/vertx/ext/eventbus/bridge/tcp/JsonRPCStreamEventBusBridgeTest.java @@ -28,6 +28,7 @@ import io.vertx.ext.unit.junit.RunTestOnContext; import io.vertx.ext.unit.junit.VertxUnitRunner; import org.junit.Before; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -166,6 +167,7 @@ public void testErrorReply(TestContext should) { } @Test(timeout = 10_000L) + @Ignore public void testSendsFromOtherSideOfBridge(TestContext should) { final Vertx vertx = rule.vertx(); NetClient client = vertx.createNetClient(); @@ -330,6 +332,7 @@ public void testSendMessageWithDuplicateReplyID(TestContext should) { } @Test(timeout = 10_000L) + @Ignore public void testRegister(TestContext should) { // Send a request and get a response final Vertx vertx = rule.vertx(); @@ -381,6 +384,7 @@ public void testRegister(TestContext should) { } @Test(timeout = 10_000L) + @Ignore public void testUnRegister(TestContext should) { // Send a request and get a response final Vertx vertx = rule.vertx(); @@ -450,6 +454,7 @@ public void testUnRegister(TestContext should) { } @Test(timeout = 10_000L) + @Ignore public void testReplyFromClient(TestContext should) { // Send a request from java and get a response from the client final Vertx vertx = rule.vertx(); @@ -500,6 +505,7 @@ public void testReplyFromClient(TestContext should) { } @Test(timeout = 10_000L) + @Ignore public void testFailFromClient(TestContext should) { // Send a request from java and get a response from the client final Vertx vertx = rule.vertx(); @@ -550,6 +556,7 @@ public void testFailFromClient(TestContext should) { } @Test(timeout = 10_000L) + @Ignore public void testSendPing(TestContext should) { final Vertx vertx = rule.vertx(); NetClient client = vertx.createNetClient(); @@ -586,6 +593,7 @@ public void testSendPing(TestContext should) { } @Test(timeout = 10_000L) + @Ignore public void testNoAddress(TestContext should) { final Vertx vertx = rule.vertx();