File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ oracledb 3.2.0 (TBD)
17
17
Thin Mode Changes
18
18
+++++++++++++++++
19
19
20
+ #) Added support for using :meth: `Queue.deqmany() ` with JSON payloads using
21
+ Oracle Database 21c.
22
+
20
23
Thick Mode Changes
21
24
++++++++++++++++++
22
25
Original file line number Diff line number Diff line change @@ -146,7 +146,15 @@ def deqmany(self, max_num_messages: int) -> list:
146
146
Dequeues up to the specified number of messages from the queue and
147
147
returns a list of these messages.
148
148
"""
149
- message_impls = self ._impl .deq_many (max_num_messages )
149
+ if self ._impl ._supports_deq_many (self ._connection ._impl ):
150
+ message_impls = self ._impl .deq_many (max_num_messages )
151
+ else :
152
+ message_impls = []
153
+ while len (message_impls ) < max_num_messages :
154
+ message_impl = self ._impl .deq_one ()
155
+ if message_impl is None :
156
+ break
157
+ message_impls .append (message_impl )
150
158
return [MessageProperties ._from_impl (impl ) for impl in message_impls ]
151
159
152
160
def deqMany (self , max_num_messages : int ) -> List ["MessageProperties" ]:
Original file line number Diff line number Diff line change 1
1
# ------------------------------------------------------------------------------
2
- # Copyright (c) 2020, 2024 , Oracle and/or its affiliates.
2
+ # Copyright (c) 2020, 2025 , Oracle and/or its affiliates.
3
3
#
4
4
# This software is dual-licensed to you under the Universal Permissive License
5
5
# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
31
31
32
32
cdef class BaseQueueImpl:
33
33
34
+ def _supports_deq_many (self , BaseConnImpl conn_impl ):
35
+ """
36
+ Returns a boolean indicating if array dequeue is supported or not. JSON
37
+ payloads are not supported by array dequeue until Oracle Database 23ai.
38
+ """
39
+ return not self .is_json or conn_impl.server_version[0 ] >= 23
40
+
34
41
def deq_many (self , uint32_t max_num_messages ):
35
42
errors._raise_not_supported(" dequeuing multiple messages" )
36
43
You can’t perform that action at this time.
0 commit comments