[
https://issues.apache.org/jira/browse/ARTEMIS-3436?focusedWorklogId=640350&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-640350
]
ASF GitHub Bot logged work on ARTEMIS-3436:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 20/Aug/21 18:57
Start Date: 20/Aug/21 18:57
Worklog Time Spent: 10m
Work Description: clebertsuconic commented on a change in pull request
#3704:
URL: https://github.com/apache/activemq-artemis/pull/3704#discussion_r693157255
##########
File path:
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
##########
@@ -4048,6 +4053,109 @@ public void testResetUser() throws Exception {
}
}
+ @Test
+ public void testReplayWithoutDate() throws Exception {
+ testReplaySimple(false);
+ }
+
+ @Test
+ public void testReplayWithDate() throws Exception {
+ testReplaySimple(true);
+ }
+
+ private void testReplaySimple(boolean useDate) throws Exception {
+ ActiveMQServerControl serverControl = createManagementControl();
+ String queue = "testQueue" + RandomUtil.randomString();
+ server.addAddressInfo(new
AddressInfo(queue).addRoutingType(RoutingType.ANYCAST));
+ server.createQueue(new
QueueConfiguration(queue).setRoutingType(RoutingType.ANYCAST).setAddress(queue));
+
+ ConnectionFactory factory = CFUtil.createConnectionFactory("core",
"tcp://localhost:61616");
+ try (Connection connection = factory.createConnection()) {
+ Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
+ javax.jms.Queue jmsQueue = session.createQueue(queue);
+ MessageProducer producer = session.createProducer(jmsQueue);
+ producer.send(session.createTextMessage("before"));
+
+ connection.start();
+ MessageConsumer consumer = session.createConsumer(jmsQueue);
+ Assert.assertNotNull(consumer.receive(5000));
+ Assert.assertNull(consumer.receiveNoWait());
+
+ serverControl.replay(queue, queue, null);
+ Assert.assertNotNull(consumer.receive(5000));
+ Assert.assertNull(consumer.receiveNoWait());
+
+ if (useDate) {
+ serverControl.replay("dontexist", "dontexist", null); // just to
force a move next file, and copy stuff into place
+ SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
+ Thread.sleep(1000); // waiting a second just to have the timestamp
change
+ String dateEnd = format.format(new Date());
+ Thread.sleep(1000); // waiting a second just to have the timestamp
change
+ System.out.println("Date End " + dateEnd);
Review comment:
remove this...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 640350)
Time Spent: 0.5h (was: 20m)
> Expose Retention as a JMX Operation replay
> ------------------------------------------
>
> Key: ARTEMIS-3436
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3436
> Project: ActiveMQ Artemis
> Issue Type: New Feature
> Reporter: Clebert Suconic
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> This should expose the journal retention as an operation replay on the JMX
> Console.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)