[
https://issues.apache.org/jira/browse/CAMEL-3540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
João Loureiro updated CAMEL-3540:
---------------------------------
Description:
Jt400DataQueueConsumer implementation of receive(long) passes the timeout
argument directly to com.ibm.as400.access.DataQueue.read(int), not performing
unit conversion. However, Jt400DataQueueConsumer.receive(long) accepts
milliseconds, whereas DataQueue.read(int) accepts seconds as the time unit.
Also, invoking Jt400DataQueueConsumer.receive() results in a call to
DataQueue.read(), which is not a blocking call; on the contrary, it will not
wait for entries.
Code snippet below.
{code:title=Jt400DataQueueConsumer.java|borderStyle=solid}
DataQueue queue = endpoint.getDataQueue();
try {
DataQueueEntry entry;
if (timeout >= 0) {
entry = queue.read((int)timeout);
} else {
entry = queue.read();
}
{code}
Note that the submitted patch floors the timeout value when converting to
seconds, but different rounding might be desired, which should be specified in
the class documentation.
was:
Jt400DataQueueConsumer implementation of receive(long) passes the timeout
argument directly to com.ibm.as400.access.DataQueue.read(int), not performing
unit conversion. However, Jt400DataQueueConsumer.receive(long) accepts
milliseconds, whereas DataQueue.read(int) accepts seconds as the time unit.
Also, invoking Jt400DataQueueConsumer.receive() results in a call to
DataQueue.read(), which is not a blocking call; on the contrary, it will not
wait for entries.
Code snippet below.
{code:title=Jt400DataQueueConsumer.java|borderStyle=solid}
DataQueue queue = endpoint.getDataQueue();
try {
DataQueueEntry entry;
if (timeout >= 0) {
entry = queue.read((int)timeout);
} else {
entry = queue.read();
}
{code}
> Jt400DataQueueConsumer incorrectly implements timeout semantics
> ---------------------------------------------------------------
>
> Key: CAMEL-3540
> URL: https://issues.apache.org/jira/browse/CAMEL-3540
> Project: Camel
> Issue Type: Bug
> Affects Versions: 2.5.0
> Reporter: João Loureiro
> Priority: Minor
> Attachments: Jt400DataQueueConsumer.patch,
> Jt400DataQueueConsumerTest.java
>
>
> Jt400DataQueueConsumer implementation of receive(long) passes the timeout
> argument directly to com.ibm.as400.access.DataQueue.read(int), not performing
> unit conversion. However, Jt400DataQueueConsumer.receive(long) accepts
> milliseconds, whereas DataQueue.read(int) accepts seconds as the time unit.
> Also, invoking Jt400DataQueueConsumer.receive() results in a call to
> DataQueue.read(), which is not a blocking call; on the contrary, it will not
> wait for entries.
> Code snippet below.
> {code:title=Jt400DataQueueConsumer.java|borderStyle=solid}
> DataQueue queue = endpoint.getDataQueue();
> try {
> DataQueueEntry entry;
> if (timeout >= 0) {
> entry = queue.read((int)timeout);
> } else {
> entry = queue.read();
> }
> {code}
> Note that the submitted patch floors the timeout value when converting to
> seconds, but different rounding might be desired, which should be specified
> in the class documentation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.