@@ -708,7 +708,7 @@ public class Example1 {
708708
709709 public static void main (String [] args ) throws Exception {
710710 ConnectionFactory factory = new ConnectionFactory ();
711- factory. setHost(& quot; localhost& quot; );
711+ factory. setHost(" localhost" );
712712 factory. setPort(5671 );
713713
714714 factory. useSslProtocol();
@@ -719,15 +719,15 @@ public class Example1 {
719719 Channel channel = conn. createChannel();
720720
721721 // non-durable, exclusive, auto-delete queue
722- channel. queueDeclare(& quot; rabbitmq- java- test& quot; , false , true , true , null );
723- channel. basicPublish(& quot; & quot;, & quot; rabbitmq- java- test& quot; , null , & quot; Hello , World & quot; . getBytes());
722+ channel. queueDeclare(" rabbitmq-java-test" , false , true , true , null );
723+ channel. basicPublish(" " , " rabbitmq-java-test" , null , " Hello, World" . getBytes());
724724
725- GetResponse chResponse = channel. basicGet(& quot; rabbitmq- java- test& quot; , false );
725+ GetResponse chResponse = channel. basicGet(" rabbitmq-java-test" , false );
726726 if (chResponse == null ) {
727- System . out. println(& quot; No message retrieved& quot; );
727+ System . out. println(" No message retrieved" );
728728 } else {
729729 byte [] body = chResponse. getBody();
730- System . out. println(& quot; Received : & quot; + new String (body));
730+ System . out. println(" Received: " + new String (body));
731731 }
732732
733733 channel. close();
@@ -777,41 +777,41 @@ import com.rabbitmq.client.*;
777777public class Example2 {
778778
779779 public static void main (String [] args ) throws Exception {
780- char [] keyPassphrase = & quot; MySecretPassword & quot; . toCharArray();
781- KeyStore ks = KeyStore . getInstance(& quot; PKCS12 & quot; );
782- ks. load(new FileInputStream (& quot; / path/ to/ client_key. p12& quot; ), keyPassphrase);
780+ char [] keyPassphrase = " MySecretPassword" . toCharArray();
781+ KeyStore ks = KeyStore . getInstance(" PKCS12" );
782+ ks. load(new FileInputStream (" /path/to/client_key.p12" ), keyPassphrase);
783783
784- KeyManagerFactory kmf = KeyManagerFactory . getInstance(& quot; SunX509 & quot; );
784+ KeyManagerFactory kmf = KeyManagerFactory . getInstance(" SunX509" );
785785 kmf. init(ks, keyPassphrase);
786786
787- char [] trustPassphrase = & quot; rabbitstore& quot; . toCharArray();
788- KeyStore tks = KeyStore . getInstance(& quot; JKS & quot; );
789- tks. load(new FileInputStream (& quot; / path/ to/ trustStore& quot; ), trustPassphrase);
787+ char [] trustPassphrase = " rabbitstore" . toCharArray();
788+ KeyStore tks = KeyStore . getInstance(" JKS" );
789+ tks. load(new FileInputStream (" /path/to/trustStore" ), trustPassphrase);
790790
791- TrustManagerFactory tmf = TrustManagerFactory . getInstance(& quot; SunX509 & quot; );
791+ TrustManagerFactory tmf = TrustManagerFactory . getInstance(" SunX509" );
792792 tmf. init(tks);
793793
794- SSLContext c = SSLContext . getInstance(& quot; TLSv1 . 2 & quot; );
794+ SSLContext c = SSLContext . getInstance(" TLSv1.2" );
795795 c. init(kmf. getKeyManagers(), tmf. getTrustManagers(), null );
796796
797797 ConnectionFactory factory = new ConnectionFactory ();
798- factory. setHost(& quot; localhost& quot; );
798+ factory. setHost(" localhost" );
799799 factory. setPort(5671 );
800800 factory. useSslProtocol(c);
801801 factory. enableHostnameVerification();
802802
803803 Connection conn = factory. newConnection();
804804 Channel channel = conn. createChannel();
805805
806- channel. queueDeclare(& quot; rabbitmq- java- test& quot; , false , true , true , null );
807- channel. basicPublish(& quot; & quot;, & quot; rabbitmq- java- test& quot; , null , & quot; Hello , World & quot; . getBytes());
806+ channel. queueDeclare(" rabbitmq-java-test" , false , true , true , null );
807+ channel. basicPublish(" " , " rabbitmq-java-test" , null , " Hello, World" . getBytes());
808808
809- GetResponse chResponse = channel. basicGet(& quot; rabbitmq- java- test& quot; , false );
809+ GetResponse chResponse = channel. basicGet(" rabbitmq-java-test" , false );
810810 if (chResponse == null ) {
811- System . out. println(& quot; No message retrieved& quot; );
811+ System . out. println(" No message retrieved" );
812812 } else {
813813 byte [] body = chResponse. getBody();
814- System . out. println(& quot; Received : & quot; + new String (body));
814+ System . out. println(" Received: " + new String (body));
815815 }
816816
817817 channel. close();
@@ -840,25 +840,25 @@ import com.rabbitmq.client.*;
840840public class Example2 {
841841
842842 public static void main (String [] args ) throws Exception {
843- char [] keyPassphrase = & quot; MySecretPassword & quot; . toCharArray();
844- KeyStore ks = KeyStore . getInstance(& quot; PKCS12 & quot; );
845- ks. load(new FileInputStream (& quot; / path/ to/ client_key. p12& quot; ), keyPassphrase);
843+ char [] keyPassphrase = " MySecretPassword" . toCharArray();
844+ KeyStore ks = KeyStore . getInstance(" PKCS12" );
845+ ks. load(new FileInputStream (" /path/to/client_key.p12" ), keyPassphrase);
846846
847- KeyManagerFactory kmf = KeyManagerFactory . getInstance(& quot; SunX509 & quot; );
847+ KeyManagerFactory kmf = KeyManagerFactory . getInstance(" SunX509" );
848848 kmf. init(ks, keyPassphrase);
849849
850- char [] trustPassphrase = & quot; rabbitstore& quot; . toCharArray();
851- KeyStore tks = KeyStore . getInstance(& quot; JKS & quot; );
852- tks. load(new FileInputStream (& quot; / path/ to/ trustStore& quot; ), trustPassphrase);
850+ char [] trustPassphrase = " rabbitstore" . toCharArray();
851+ KeyStore tks = KeyStore . getInstance(" JKS" );
852+ tks. load(new FileInputStream (" /path/to/trustStore" ), trustPassphrase);
853853
854- TrustManagerFactory tmf = TrustManagerFactory . getInstance(& quot; SunX509 & quot; );
854+ TrustManagerFactory tmf = TrustManagerFactory . getInstance(" SunX509" );
855855 tmf. init(tks);
856856
857- SSLContext c = SSLContext . getInstance(& quot; TLSv1 . 2 & quot; );
857+ SSLContext c = SSLContext . getInstance(" TLSv1.2" );
858858 c. init(kmf. getKeyManagers(), tmf. getTrustManagers(), null );
859859
860860 ConnectionFactory factory = new ConnectionFactory ();
861- factory. setHost(& quot; localhost& quot; );
861+ factory. setHost(" localhost" );
862862 factory. setPort(5671 );
863863 factory. useSslProtocol(c);
864864 factory. enableHostnameVerification();
@@ -887,7 +887,7 @@ or a `SSLContext`:
887887
888888``` java
889889ConnectionFactory factory = new ConnectionFactory ();
890- factory. setHost(& quot; localhost& quot; );
890+ factory. setHost(" localhost" );
891891factory. setPort(5671 );
892892
893893factory. useSslProtocol(" TLSv1.2" );
@@ -2143,9 +2143,9 @@ will change in a future RabbitMQ Erlang client release.
21432143### Code Example {#erlang-code-example}
21442144
21452145``` erlang
2146- SslOpts = [{cacertfile , & quot ; / path / to / ca_certificate .pem & quot ; },
2147- {certfile , & quot ; / path / to / client / certificate .pem & quot ; },
2148- {keyfile , & quot ; / path / to / client / private_key .pem & quot ; },
2146+ SslOpts = [{cacertfile , " /path/to/ca_certificate.pem" },
2147+ {certfile , " /path/to/client/certificate.pem" },
2148+ {keyfile , " /path/to/client/private_key.pem" },
21492149
21502150 % % only necessary with intermediate CAs
21512151 % % {depth, 2},
0 commit comments