[ACS-1291] Asynchronous mechanism to send events (#351)

* Performance optimisation spike

* Event2 is now sending event asynchronously

* Now forcing synchronous calls in tests for events2

* Now qualifying the event service used in tests

Co-authored-by: Nana Insaidoo <insaidoo.nana@yahoo.it>
This commit is contained in:
Bruno Bossola
2021-03-19 11:08:13 +00:00
committed by GitHub
parent a9dabb0e99
commit f446031069
4 changed files with 64 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ import static org.awaitility.Awaitility.await;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executor;
import javax.jms.ConnectionFactory;
@@ -104,6 +105,10 @@ public abstract class AbstractContextAwareRepoEvent extends BaseSpringTest
@Autowired
protected ObjectMapper event2ObjectMapper;
@Autowired @Qualifier("eventGeneratorV2")
protected EventGenerator eventGenerator;
protected NodeRef rootNodeRef;
@BeforeClass
@@ -143,6 +148,18 @@ public abstract class AbstractContextAwareRepoEvent extends BaseSpringTest
});
}
@Before
public void forceEventGeneratorToBeSynchronous() {
eventGenerator.setThreadPoolExecutor(new Executor()
{
@Override
public void execute(Runnable command)
{
command.run();
}
});
}
@After
public void tearDown()
{