INT-1719 added setDeliveryPersistent method to JmsOutboundGateway, fixed the schema and the parser
This commit is contained in:
@@ -20,6 +20,7 @@ import java.util.UUID;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.DeliveryMode;
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.MessageConsumer;
|
||||
@@ -93,6 +94,18 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler {
|
||||
|
||||
private final Object initializationMonitor = new Object();
|
||||
|
||||
/**
|
||||
* Set whether message delivery should be persistent or non-persistent,
|
||||
* specified as boolean value ("true" or "false"). This will set the delivery
|
||||
* mode accordingly, to either "PERSISTENT" (1) or "NON_PERSISTENT" (2).
|
||||
* <p>Default it "true" aka delivery mode "PERSISTENT".
|
||||
* @see #setDeliveryMode(int)
|
||||
* @see javax.jms.DeliveryMode#PERSISTENT
|
||||
* @see javax.jms.DeliveryMode#NON_PERSISTENT
|
||||
*/
|
||||
public void setDeliveryPersistent(boolean deliveryPersistent) {
|
||||
this.deliveryMode = (deliveryPersistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the JMS ConnectionFactory that this gateway should use.
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.springframework.integration.jms.config;
|
||||
|
||||
import javax.jms.DeliveryMode;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.w3c.dom.Element;
|
||||
@@ -87,13 +85,7 @@ public class JmsOutboundGatewayParser extends AbstractConsumerEndpointParser {
|
||||
builder.addPropertyValue("deliveryMode", deliveryMode);
|
||||
}
|
||||
else if (StringUtils.hasText(deliveryPersistent)){
|
||||
boolean persistentValue = Boolean.parseBoolean(deliveryPersistent);
|
||||
if (persistentValue){
|
||||
builder.addPropertyValue("deliveryMode", DeliveryMode.PERSISTENT);
|
||||
}
|
||||
else {
|
||||
builder.addPropertyValue("deliveryMode", DeliveryMode.NON_PERSISTENT);
|
||||
}
|
||||
builder.addPropertyValue("deliveryPersistent", deliveryPersistent);
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
@@ -738,7 +738,7 @@
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="delivery-persistent" type="xsd:boolean" default="false">
|
||||
<xsd:attribute name="delivery-persistent" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Specify a boolean value indicating whether the delivery mode should be
|
||||
|
||||
Reference in New Issue
Block a user