File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -596,6 +596,8 @@ messages in between sending the cancel method and receiving the cancel-ok reply.
596
596
(:method ((class amqp ::channel) &key &allow-other-keys )
597
597
class )))
598
598
599
+ (defparameter *publish-expiration* " 100000"
600
+ " Value in milliseconds. COuld also be a default value in the instance, but this is more direct," )
599
601
600
602
(def-amqp-command amqp :publish (class &key body exchange routing-key mandatory immediate
601
603
content-type content-encoding headers delivery-mode
@@ -625,6 +627,7 @@ any, is committed.")
625
627
(:method ((basic amqp :basic) &rest args &key (body nil body-s)
626
628
(exchange nil e-s) (routing-key nil rk-s)
627
629
(user-id (or (basic-user-id basic) " " ))
630
+ (expiration *publish-expiration* )
628
631
&allow-other-keys )
629
632
(when e-s
630
633
(setf exchange (amqp :exchange-exchange exchange)) ; coerce to a string
@@ -636,7 +639,8 @@ any, is committed.")
636
639
(remf args :body ))
637
640
(apply #' shared-initialize basic t args)
638
641
(let ((channel (object-channel basic)))
639
- (apply #' device-write-content channel body :exchange exchange :user-id user-id args)))))
642
+ (apply #' device-write-content channel body :exchange exchange :user-id user-id
643
+ :expiration expiration args)))))
640
644
641
645
642
646
(def-amqp-command amqp :purge (class &key queue no-wait)
Original file line number Diff line number Diff line change 34
34
(read-line input))
35
35
36
36
37
+ ; ;; fails
38
+
39
+ DEVICE-READ : Required device state USE-CHANNEL.BODY.INPUT is not satisfied by #<USE-CHANNEL
40
+
41
+ {1001DFFF11}>.
42
+
43
+ Type HELP for debugger help, or (SB-EXT :QUIT) to exit from SBCL.
44
+
45
+ restarts (invokable by number or by possibly-abbreviated name):
46
+ 0 : [CONTINUE] Retry assertion.
47
+ 1 : [ABORT ] Exit debugger, returning to top level.
48
+
49
+ (SB-KERNEL :ASSERT-ERROR
50
+ (TYPEP # :G360 ' AMQP.S:USE-CHANNEL.BODY.INPUT)
51
+ NIL
52
+ " ~@[ ~a : ~] Required device state ~a is not satisfied by ~a ."
53
+ DEVICE-READ
54
+ AMQP.S :USE-CHANNEL.BODY.INPUT
55
+ #<AMQP.S:USE-CHANNEL {1001DFFF11}>)
56
+ 0]
57
+
37
58
38
59
(amqp :with-open-channel (output *c* :exchange " ex" :type " direct" :queue " q1" )
39
60
(let ((message ' (" there" " comes" " a" " time" " when" " the" " mind" " takes" " a" " higher" " plane"
49
70
(amqp :with-open-channel (input *c* :queue " q1" )
50
71
(loop
51
72
(unless (print (read-line input nil nil ))
52
- (return ))))
73
+ (return ))))
74
+
75
+ (close *c* :abort t )
Original file line number Diff line number Diff line change 53
53
(amqp :request-publish *ch1.basic* :exchange *ch1.ex*
54
54
:body (format nil " a test message" )
55
55
:routing-key " foaf" )
56
+ ; ; should yield the message
56
57
(amqp :request-get *ch2.basic* :queue *ch2.q* )
58
+ ; ; should be empty
57
59
(amqp :request-get *ch1.basic* :queue *ch1.q* ))
58
60
59
61
#|
You can’t perform that action at this time.
0 commit comments