@@ -159,19 +159,36 @@ protected GetResponse basicGet(String q) throws IOException {
159159 }
160160
161161 protected void basicPublishPersistent (String q ) throws IOException {
162- channel . basicPublish ( "" , q , MessageProperties . PERSISTENT_TEXT_PLAIN , "persistent message" .getBytes ());
162+ basicPublishPersistent ( "persistent message" .getBytes (), q );
163163 }
164164
165- protected void basicPublishPersistent (String x , String routingKey ) throws IOException {
166- channel . basicPublish ( x , routingKey , MessageProperties . PERSISTENT_TEXT_PLAIN , "persistent message" . getBytes () );
165+ protected void basicPublishPersistent (byte [] msg , String q ) throws IOException {
166+ basicPublishPersistent ( msg , "" , q );
167167 }
168168
169+ protected void basicPublishPersistent (String x , String routingKey ) throws IOException {
170+ basicPublishPersistent ("persistent message" .getBytes (), x , routingKey );
171+ }
172+
173+
174+ protected void basicPublishPersistent (byte [] msg , String x , String routingKey ) throws IOException {
175+ channel .basicPublish (x , routingKey , MessageProperties .PERSISTENT_TEXT_PLAIN , msg );
176+ }
177+
169178 protected void basicPublishVolatile (String q ) throws IOException {
170- channel .basicPublish ("" , q , MessageProperties .TEXT_PLAIN , "not persistent message" .getBytes ());
179+ basicPublishVolatile ("not persistent message" .getBytes (), q );
180+ }
181+
182+ protected void basicPublishVolatile (byte [] msg , String q ) throws IOException {
183+ basicPublishVolatile (msg , "" , q );
171184 }
172185
173186 protected void basicPublishVolatile (String x , String routingKey ) throws IOException {
174- channel .basicPublish (x , routingKey , MessageProperties .TEXT_PLAIN , "not persistent message" .getBytes ());
187+ basicPublishVolatile ("not persistent message" .getBytes (), x , routingKey );
188+ }
189+
190+ protected void basicPublishVolatile (byte [] msg , String x , String routingKey ) throws IOException {
191+ channel .basicPublish (x , routingKey , MessageProperties .TEXT_PLAIN , msg );
175192 }
176193
177194 protected void declareAndBindDurableQueue (String q , String x , String r ) throws IOException {
0 commit comments