Add reconnection logic to SimpleMessageListenerContainer.
Test for SimpleMessageListenerContainer's ExceptionListener being invoked (SPRNET-542)
This commit is contained in:
@@ -1266,6 +1266,22 @@ namespace MyApp
|
||||
important; consider raising it for general
|
||||
queues.</para></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>recovery-interval</entry>
|
||||
|
||||
<entry><para>The time interval between connection recovery attempts. The default is 5 seconds.
|
||||
Specify as a TimeSpan value using Spring's TimeSpanConverter (e.g. 10s, 10m, 3h, etc)
|
||||
</para></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>max-recovery-time</entry>
|
||||
|
||||
<entry><para>The maximum time try reconnection attempts. The default is 10 minutes. Specify as a
|
||||
TimeSpan value using Spring's TimeSpanConverter (e.g. 10s, 10m, 3h, etc)
|
||||
</para></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Spring.Messaging.Nms.Config
|
||||
|
||||
private readonly string RECOVERY_INTERVAL_ATTRIBUTE = "recovery-interval";
|
||||
|
||||
private readonly string MAX_RECOVERY_INTERVAL_ATTRIBUTE = "max-recovery-interval";
|
||||
private readonly string MAX_RECOVERY_TIME_ATTRIBUTE = "max-recovery-time";
|
||||
|
||||
private readonly string CONNECTION_FACTORY_ATTRIBUTE = "connection-factory";
|
||||
|
||||
@@ -392,7 +392,7 @@ namespace Spring.Messaging.Nms.Config
|
||||
}
|
||||
private TimeSpan ParseMaxRecoveryTime(XmlElement ele, ParserContext parserContext)
|
||||
{
|
||||
string recoverTime = ele.GetAttribute(MAX_RECOVERY_INTERVAL_ATTRIBUTE);
|
||||
string recoverTime = ele.GetAttribute(MAX_RECOVERY_TIME_ATTRIBUTE);
|
||||
if (!StringUtils.HasText(recoverTime))
|
||||
{
|
||||
return SimpleMessageListenerContainer.DEFAULT_MAX_RECOVERY_TIME;
|
||||
@@ -404,7 +404,7 @@ namespace Spring.Messaging.Nms.Config
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
parserContext.ReaderContext.ReportException(ele, MAX_RECOVERY_INTERVAL_ATTRIBUTE,
|
||||
parserContext.ReaderContext.ReportException(ele, MAX_RECOVERY_TIME_ATTRIBUTE,
|
||||
"Invalid max-recovery-time value [" + recoverTime + "]", ex);
|
||||
return SimpleMessageListenerContainer.DEFAULT_MAX_RECOVERY_TIME;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,6 @@
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="max-recovery-time" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
|
||||
Reference in New Issue
Block a user