Merge pull request #22 from lyndonadams/SGF-144
Parallel flag been added to the asynch-event-queue. Issue SGF-144.
This commit is contained in:
@@ -45,6 +45,8 @@ public class AsyncEventQueueFactoryBean extends AbstractWANComponentFactoryBean<
|
||||
private Boolean persistent;
|
||||
|
||||
private String diskStoreRef;
|
||||
|
||||
private Boolean parallel;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -87,10 +89,12 @@ public class AsyncEventQueueFactoryBean extends AbstractWANComponentFactoryBean<
|
||||
Assert.isTrue(persistent, "specifying a disk store requires persistent property to be true");
|
||||
asyncEventQueueFactory.setDiskStoreName(diskStoreRef);
|
||||
}
|
||||
|
||||
if (maximumQueueMemory != null) {
|
||||
asyncEventQueueFactory.setMaximumQueueMemory(maximumQueueMemory);
|
||||
}
|
||||
if( parallel != null ){
|
||||
asyncEventQueueFactory.setParallel( parallel );
|
||||
}
|
||||
|
||||
asyncEventQueue = asyncEventQueueFactory.create(getName(), asyncEventListener);
|
||||
}
|
||||
@@ -118,4 +122,8 @@ public class AsyncEventQueueFactoryBean extends AbstractWANComponentFactoryBean<
|
||||
public void setPersistent(Boolean persistent) {
|
||||
this.persistent = persistent;
|
||||
}
|
||||
|
||||
public void setParallel(Boolean parallel){
|
||||
this.parallel = parallel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2407,49 +2407,48 @@ THREAD:Indicates that events will be parallelized based on the event's originati
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="parallel" type="xsd:string"
|
||||
use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Specifies whether all VMs need to distribute events to remote site. In this case only the events originating in a particular VM will be dispatched in order.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
<!-- -->
|
||||
<xsd:attributeGroup name="commonWANQueueAttributes">
|
||||
<xsd:attribute name="batch-size" type="xsd:string"
|
||||
use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
<xsd:attribute name="batch-size" type="xsd:string"
|
||||
use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Specifies the batch size
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="persistent" type="xsd:string"
|
||||
use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="persistent" type="xsd:string"
|
||||
use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Specifies whether persistence is enabled: true or false(default)
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="disk-store-ref" type="xsd:string"
|
||||
use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="disk-store-ref" type="xsd:string"
|
||||
use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Indicates the id of disk store to use for persistence
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="maximum-queue-memory" type="xsd:string"
|
||||
use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="maximum-queue-memory" type="xsd:string"
|
||||
use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Specifies the maximum memory in MB to allocate for the queue
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="parallel" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
A value of "false" or "true" that specifies the type of queue GemFire creates, serial or parallel.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:attribute>
|
||||
</xsd:attributeGroup>
|
||||
<!-- -->
|
||||
<xsd:complexType name="gatewayReceiverType">
|
||||
@@ -2615,26 +2614,26 @@ The id of the cache - default is gemfireCache
|
||||
<!-- -->
|
||||
<xsd:element name="async-event-queue">
|
||||
<xsd:complexType>
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="baseAsyncEventQueueType">
|
||||
<xsd:attribute name="id" type="xsd:string"
|
||||
use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="baseAsyncEventQueueType">
|
||||
<xsd:attribute name="id" type="xsd:string"
|
||||
use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The id of this bean definition.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="cache-ref" type="xsd:string"
|
||||
use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="cache-ref" type="xsd:string"
|
||||
use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The id of the cache - default is gemfireCache
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
|
||||
@@ -105,10 +105,11 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
|
||||
AsyncEventQueue aseq = ctx.getBean("async-event-queue", AsyncEventQueue.class);
|
||||
assertEquals(10, aseq.getBatchSize());
|
||||
assertTrue(aseq.isPersistent());
|
||||
assertTrue(aseq.isParallel());
|
||||
assertEquals("diskstore", aseq.getDiskStoreName());
|
||||
assertEquals(50, aseq.getMaximumQueueMemory());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testGatewaySender() throws Exception {
|
||||
GatewaySenderFactoryBean gwsfb = ctx.getBean("&gateway-sender", GatewaySenderFactoryBean.class);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</gfe:partitioned-region>
|
||||
|
||||
<gfe:async-event-queue id="async-event-queue" batch-size="10" persistent="true" disk-store-ref="diskstore"
|
||||
maximum-queue-memory="50">
|
||||
maximum-queue-memory="50" parallel="true">
|
||||
<gfe:async-event-listener>
|
||||
<bean class="org.springframework.data.gemfire.config.GemfireV7GatewayNamespaceTest.TestAsyncEventListener"/>
|
||||
</gfe:async-event-listener>
|
||||
|
||||
Reference in New Issue
Block a user