@@ -84,7 +84,7 @@ First, let's send a message using nothing but pure Python code::
84
84
queue1 = "TEST.1"
85
85
86
86
# The connection factory we're going to use.
87
- factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port)
87
+ factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port, needs_mcd=False )
88
88
89
89
# Every JmsTemplate uses a connection factory for actually communicating with a JMS provider.
90
90
jms_template = JmsTemplate(factory)
@@ -110,6 +110,7 @@ be saved in::
110
110
channel: SVRCONN.1
111
111
host: 192.168.1.121
112
112
listener_port: "1434"
113
+ needs_mcd: False
113
114
114
115
- object: MyTemplate
115
116
class: springpython.jms.core.JmsTemplate
@@ -162,7 +163,7 @@ examples do, they are repeated here for the sake of completness::
162
163
queue1 = "TEST.1"
163
164
164
165
# The connection factory we're going to use.
165
- factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port)
166
+ factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port, needs_mcd=False )
166
167
167
168
# Every JmsTemplate uses a connection factory for actually communicating with a JMS provider.
168
169
jms_template = JmsTemplate(factory)
@@ -189,6 +190,7 @@ that was used in the sending example::
189
190
channel: SVRCONN.1
190
191
host: 192.168.1.121
191
192
listener_port: "1434"
193
+ needs_mcd: False
192
194
193
195
- object: MyTemplate
194
196
class: springpython.jms.core.JmsTemplate
@@ -233,6 +235,7 @@ fact of providing the configuration allows for receiving the messages::
233
235
channel: SVRCONN.1
234
236
host: 192.168.1.121
235
237
listener_port: "1434"
238
+ needs_mcd: False
236
239
237
240
- object: message_handler
238
241
class: app.MyMessageHandler
@@ -406,6 +409,14 @@ of default values used::
406
409
| | client-repo.sth, then ssl_key_repository must be set |
407
410
| | to "/var/mqm/security/client-repo". |
408
411
+------------------------------+-------------------------------------------------------+
412
+ | **needs_mcd ** | default: True |
413
+ | + +
414
+ | | Whether to add the *mcd * JMS folder to outgoing |
415
+ | | messages. This defaults to True for |
416
+ | | backward-compatibility reasons but should be always |
417
+ | | set to False if working with WebSphere MQ 7.0 |
418
+ | | or newer. |
419
+ +------------------------------+-------------------------------------------------------+
409
420
410
421
Here's an example of programatically creating a
411
422
:ref: `WebSphereMQConnectionFactory <jms-webspheremqconnectionfactory >` object::
@@ -417,7 +428,7 @@ Here's an example of programatically creating a
417
428
host = "192.168.1.121"
418
429
listener_port = "1434"
419
430
420
- factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port)
431
+ factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port, needs_mcd=False )
421
432
422
433
# ... use factory here.
423
434
@@ -437,6 +448,7 @@ inside of an IoC container::
437
448
channel: SVRCONN.1
438
449
host: 192.168.1.121
439
450
listener_port: "1434"
451
+ needs_mcd: False
440
452
441
453
All cached queues will not be closed by a factory until after its .destroy will
442
454
have been called which will happen automatically if you're using an IoC container.
@@ -491,7 +503,7 @@ Here's how a JmsTemplate may be instantiated using Python code::
491
503
host = "192.168.1.121"
492
504
listener_port = "1434"
493
505
494
- factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port)
506
+ factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port, needs_mcd=False )
495
507
jms_template = JmsTemplate(factory)
496
508
497
509
# Always destroy the factory when not using IoC
@@ -509,6 +521,7 @@ An example of using YamlConfig to configure a JmsTemplate::
509
521
channel: SVRCONN.1
510
522
host: 192.168.1.121
511
523
listener_port: "1434"
524
+ needs_mcd: False
512
525
513
526
- object: jms_template
514
527
class: springpython.jms.core.JmsTemplate
@@ -613,7 +626,7 @@ for encoding into UTF-8::
613
626
queue1 = "TEST.1"
614
627
615
628
# The connection factory we're going to use.
616
- factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port)
629
+ factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port, needs_mcd=False )
617
630
618
631
# Every JmsTemplate uses a connection factory for actually communicating with a JMS provider.
619
632
jms_template = JmsTemplate(factory)
@@ -679,7 +692,7 @@ destination can be specified for an outgoing message::
679
692
queue1 = "TEST.1"
680
693
681
694
# The connection factory we're going to use.
682
- factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port)
695
+ factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port, needs_mcd=False )
683
696
684
697
# Every JmsTemplate uses a connection factory for actually communicating with a JMS provider.
685
698
jms_template = JmsTemplate(factory)
@@ -714,7 +727,7 @@ jms_timestamp and jms_message_id properties::
714
727
queue1 = "TEST.1"
715
728
716
729
# The connection factory we're going to use.
717
- factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port)
730
+ factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port, needs_mcd=False )
718
731
719
732
# Every JmsTemplate uses a connection factory for actually communicating with a JMS provider.
720
733
jms_template = JmsTemplate(factory)
@@ -765,7 +778,7 @@ can explicitly specify the destination's name when you receive messages::
765
778
queue2 = "TEST.2"
766
779
767
780
# The connection factory we're going to use.
768
- factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port)
781
+ factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port, needs_mcd=False )
769
782
770
783
# Every JmsTemplate uses a connection factory for actually communicating with a JMS provider.
771
784
jms_template = JmsTemplate(factory)
@@ -831,7 +844,7 @@ default with Spring Python::
831
844
exchange_queue = "TEST.1"
832
845
833
846
# The connection factory we're going to use.
834
- factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port)
847
+ factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port, needs_mcd=False )
835
848
836
849
requesting_side = JmsTemplate(factory)
837
850
requesting_side.default_destination = exchange_queue
@@ -958,7 +971,7 @@ requests and responses using only one converter object::
958
971
return invoice
959
972
960
973
# The connection factory we're going to use.
961
- factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port)
974
+ factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port, needs_mcd=False )
962
975
963
976
# Our JmsTemplate.
964
977
jms_template = JmsTemplate(factory)
@@ -1058,6 +1071,7 @@ has been set::
1058
1071
channel: SVRCONN.1
1059
1072
host: 192.168.1.121
1060
1073
listener_port: "1434"
1074
+ needs_mcd: False
1061
1075
1062
1076
- object: message_handler
1063
1077
class: app.MyMessageHandler
0 commit comments