Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support headers with different header length #13

Merged
merged 3 commits into from
Feb 27, 2018

Conversation

JananiKugaa
Copy link
Contributor

Purpose

support the message with the different header length

Goals

Implement the connector to support iso8583 message with header

Approach

User stories

Release note

Documentation

Training

Certification

Marketing

Automation tests

Security checks

Samples

Related PRs

Migrations (if applicable)

Test environment

JDK versions-1.8
Operating systems-Ubuntu 16.04
Product- EI-6.1.1

@@ -19,5 +19,6 @@
<template xmlns="http://ws.apache.org/ns/synapse" name="sendMessage">
<sequence>
<class name="org.wso2.carbon.connector.iso8583.ISO8583MessageProducer"/>
<script language="js"><![CDATA[mc.getEnvelope().getBody().getFirstElement().detach();]]></script>
</sequence>
</template>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we add a new line here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

if ((message = inFromServer.readLine()) != null) {
unpackResponse(messageContext, message);
}
Thread.sleep(200);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you put 200 sleep here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will take time to get the response from the back end in the input stream buffer. That's why I put.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check without it ...

try {
outStream = new DataOutputStream(connection.getOutputStream());
inFromServer = new BufferedReader(new InputStreamReader(connection.getInputStream()));
inFromServer = new DataInputStream(connection.getInputStream());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Furthermore it is wrong to close connection in this finally block. It should be closed by the method who creates it in it's finally block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Close the socket connection where it was created, in it's finally block.
Read the byte from input stream with out sleep the thread.
@keerthu keerthu merged commit 7dc77c6 into wso2-extensions:master Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants