mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
[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:
@@ -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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user