[jboss-jira] [JBoss JIRA] (JGRP-2024) Receiving messages out of order.
Bela Ban (JIRA)
issues at jboss.org
Sat Mar 5 03:20:00 EST 2016
[ https://issues.jboss.org/browse/JGRP-2024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172379#comment-13172379 ]
Bela Ban edited comment on JGRP-2024 at 3/5/16 3:19 AM:
--------------------------------------------------------
The second bug in your code is in this line:
{code}
channel.send(new Message(null, fileByte, 0, fileByte.length));
{code}
This will read the last line that is less than 128 bytes incorrectly. The correct line should be
{code}
channel.send(new Message(null, fileByte, 0, bytesRead));
{code}
I attached the correct version, you need to change the file paths.
Note that I used JGroups _master_ not 3.6.x, but the change to get it to run on 3.6.x is minimal.
was (Author: belaban):
The second bug in your code is in this line:
{code}
channel.send(new Message(null, fileByte, 0, fileByte.length));
{code}
This will read the last line that is less than 128 bytes incorrectly. The correct line should be
{code}
channel.send(new Message(null, fileByte, 0, bytesRead));
{code}
I attached the correct version, you need to change the file paths.
> Receiving messages out of order.
> --------------------------------
>
> Key: JGRP-2024
> URL: https://issues.jboss.org/browse/JGRP-2024
> Project: JGroups
> Issue Type: Bug
> Affects Versions: 3.6.7, 3.6.8
> Environment: RedHat 6.7
> Java 1.8.0 Update 45
> Reporter: Dylan Turnbull
> Assignee: Bela Ban
> Fix For: 4.0
>
> Attachments: jGroups Unit Test.zip, JGroupsMessageTest.java, jGroupsTestReciever.java
>
>
> After splitting a file into smaller messages and send them down the channel the messages are received on the other side out of order.
> Below is a sample output:
> *+On the sender:+*
> Sending...
> Data Sent:
> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy te
> -----------------------------------------------------
> Data Sent:
> xt ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has sur
> -----------------------------------------------------
> Data Sent:
> vived not only five centuries, but also the leap into electronic typesetting, re
> -----------------------------------------------------
> Data Sent:
> d in the 1960s with the release of Letraset sheets containing Lorem Ipsum passag
> *+On the receiver:+*
> Listening...
> Data Received:
> xt ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has sur
> -----------------------------------------------------
> Data Received:
> vived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularise
> -----------------------------------------------------
> Data Received:
> d in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing so
> -----------------------------------------------------
> Data Received:
> ftware like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum passages, and more recently with desktop publishing so
> -----------------------------------------------------
> Data Received:
> ftware like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum passages, and more recently with desktop publishing so
> -----------------------------------------------------
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list