You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/04/07 15:55:00 UTC

[jira] [Work logged] (ARTEMIS-4234) EmbeddedActiveMQResource is able to receive only first message

     [ https://issues.apache.org/jira/browse/ARTEMIS-4234?focusedWorklogId=855537&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-855537 ]

ASF GitHub Bot logged work on ARTEMIS-4234:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Apr/23 15:54
            Start Date: 07/Apr/23 15:54
    Worklog Time Spent: 10m 
      Work Description: tabish121 opened a new pull request, #4429:
URL: https://github.com/apache/activemq-artemis/pull/4429

   The JUnit resource has a couple bugs in both the send and receive path that result in only one message being received if the receive method is called repeatedly and some send drop the provided properties. Cleaned up some tests to the point of showing the errors and ensuring that at least basic functionality is tested.




Issue Time Tracking
-------------------

            Worklog Id:     (was: 855537)
    Remaining Estimate: 0h
            Time Spent: 10m

> EmbeddedActiveMQResource is able to receive only first message
> --------------------------------------------------------------
>
>                 Key: ARTEMIS-4234
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4234
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.28.0
>            Reporter: Dominik Kawczyński
>            Assignee: Timothy A. Bish
>            Priority: Major
>             Fix For: 2.29.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hi,
> i have encountered a problem with embedded Artemis.
> Using *EmbeddedActiveMQResource* _receiveMessage_ method im able to receive only one message from queue.
> Please look at following code:
> {code:java}
> artemis.start()
> def firstMessage = 'test message 1'
> sendMessage(firstMessage, 'test_queue')
> def firstReceivedMessage = artemis.receiveMessage('test_queue', 1000)
> println('>>>>>>>> FIRST MESSAGE:')
> println('>>>>>>>>' + firstReceivedMessage.stringBody)
> /*
> will work if artemis is restarted during test
> artemis.stop()
> artemis.start()
> */
> def secondMessage = 'test message 2'
> sendMessage(secondMessage, 'test_queue')
> def secondReceivedMessage = artemis.receiveMessage('test_queue', 1000)
> println('>>>>>>>> SECOND MESSAGE:')
> println('>>>>>>>>' + secondReceivedMessage.stringBody)
> then:
> firstMessage == firstReceivedMessage.stringBody
> secondMessage == secondReceivedMessage.stringBody {code}
> I'm getting null as secondReceivedMessage, and NPE in effect later.
>  
> The reason is (i assume) that first invocation  is creating a consumer, that is getting second message, before i invoke receiveMessage method second time (i see in logs that second message was consumed)
>  
> Is this expected behavior?
> receiveMessage is returning only one message, so my assumption was, that i can invoke it several times to retrieve consequential messages, and i have not found any documentation explaining current behavior.
>  
> I have created repo with reproducible example:
> [https://github.com/dmkaw/embedded-artemis-issue]
>  
> Thanks in advance.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)