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)
1717Thin Mode Changes
1818+++++++++++++++++
1919
20+ #) Added support for using :meth: `Queue.deqmany() ` with JSON payloads using
21+ Oracle Database 21c.
22+
2023Thick Mode Changes
2124++++++++++++++++++
2225
Original file line number Diff line number Diff line change @@ -146,7 +146,15 @@ def deqmany(self, max_num_messages: int) -> list:
146146 Dequeues up to the specified number of messages from the queue and
147147 returns a list of these messages.
148148 """
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 )
150158 return [MessageProperties ._from_impl (impl ) for impl in message_impls ]
151159
152160 def deqMany (self , max_num_messages : int ) -> List ["MessageProperties" ]:
Original file line number Diff line number Diff line change 11# ------------------------------------------------------------------------------
2- # Copyright (c) 2020, 2024 , Oracle and/or its affiliates.
2+ # Copyright (c) 2020, 2025 , Oracle and/or its affiliates.
33#
44# This software is dual-licensed to you under the Universal Permissive License
55# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
3131
3232cdef class BaseQueueImpl:
3333
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+
3441 def deq_many (self , uint32_t max_num_messages ):
3542 errors._raise_not_supported(" dequeuing multiple messages" )
3643
You can’t perform that action at this time.
0 commit comments