Exemplo n.º 1
0
def create_stream_queue_message_ack_request(_queue, msg_sequence):
    """Create StreamQueueMessageRequest for ack"""
    return StreamQueueMessagesRequest(
        ClientID=_queue.client_id,
        Channel=_queue.queue_name,
        RequestID=get_next_id(),
        StreamRequestTypeData=AckMessage,
        VisibilitySeconds=0,
        WaitTimeSeconds=0,
        ModifiedMessage=None,
        RefSequence=msg_sequence
    )
Exemplo n.º 2
0
def create_stream_queue_message_check_call_is_in_transaction_request(_queue):
    """Create empty for checking check_call_is_in_transaction"""
    return StreamQueueMessagesRequest(
        ClientID=_queue.client_id,
        Channel=_queue.queue_name,
        RequestID=get_next_id(),
        StreamRequestTypeData=StreamRequestTypeUnknown,
        VisibilitySeconds=20,
        WaitTimeSeconds=8,
        ModifiedMessage=QueueMessage(),
        RefSequence=0
    )
Exemplo n.º 3
0
def create_stream_queue_message_receive_request(queue, visibility_seconds, wait_time_seconds=None):
    """Create StreamQueueMessageRequest for receive"""
    return StreamQueueMessagesRequest(
        ClientID=queue.client_id,
        Channel=queue.queue_name,
        RequestID=get_next_id(),
        StreamRequestTypeData=ReceiveMessage,
        VisibilitySeconds=visibility_seconds,
        WaitTimeSeconds=wait_time_seconds or queue.WaitTimeSecondsQueueMessages,
        ModifiedMessage=QueueMessage(),
        RefSequence=0
    )
Exemplo n.º 4
0
def create_stream_queue_message_modify_request(_queue, message):
    """Create StreamQueueMessageRequest for modify"""
    return StreamQueueMessagesRequest(
        ClientID=_queue.client_id,
        Channel="",
        RequestID=get_next_id(),
        StreamRequestTypeData=SendModifiedMessage,
        VisibilitySeconds=0,
        WaitTimeSeconds=0,
        ModifiedMessage=message,
        RefSequence=0
    )
Exemplo n.º 5
0
def create_stream_queue_message_resend_request(_queue, queue_name):
    """Create StreamQueueMessageRequest for resend"""
    return StreamQueueMessagesRequest(
        ClientID=_queue.client_id,
        Channel=queue_name,
        RequestID=get_next_id(),
        StreamRequestTypeData=ResendMessage,
        VisibilitySeconds=0,
        WaitTimeSeconds=0,
        ModifiedMessage=None,
        RefSequence=0
    )
Exemplo n.º 6
0
def create_stream_queue_message_extend_visibility_request(_queue, visibility):
    """Create StreamQueueMessageRequest for extend_visibility"""
    return StreamQueueMessagesRequest(
        ClientID=_queue.client_id,
        Channel=_queue.queue_name,
        RequestID=get_next_id(),
        StreamRequestTypeData=ModifyVisibility,
        VisibilitySeconds=visibility,
        WaitTimeSeconds=0,
        ModifiedMessage=None,
        RefSequence=0
    )