-
Notifications
You must be signed in to change notification settings - Fork 181
Added the java samples #336
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the put hasn't been implemented, plus a series of other review comments that need to be addressed.
| ```bash | ||
| mvn exec:java \ | ||
| -Dexec.mainClass="com.ibm.mq.samples.java.<ClassName>" \ | ||
| -Dexec.args="-Dcom.ibm.mq.cfg.jmqiDisableAsyncThreads=true" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an explanation as to why we have to set com.ibm.mq.cfg.jmqiDisableAsyncThreads
| @@ -0,0 +1,48 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In stead of duplicating this file, is it possible to use the env.json in the root directory of this repo?
| } | ||
|
|
||
| } catch (com.ibm.mq.MQException e) { | ||
| System.out.println("Could not connect to queue manager — reason code: " + e.getReason()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cause for this exception could be either the connectQueue or the getMessage.
|
|
||
| } catch (com.ibm.mq.MQException e) { | ||
| System.out.println("Could not connect to queue manager — reason code: " + e.getReason()); | ||
| } catch (Exception e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if there are no more messages. EG. there are 3 messages on the queue, but you are attempting to get 5?
| connList.setLength(connList.length() - 1); | ||
|
|
||
| // Put into properties | ||
| props.put("connectionString", connList.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is the connectionString being used?
A connection string should be used on a put / publish. So if the first host / port in the string is available, the message goes to the second host / port in the list. IE. you are putting the message(s) on a single queue.
On a get you would want to attempt to drain all queues that are available, upto the limit of messages the app has been asked to get.
| break; | ||
| case PRODUCER_PUBLISH: | ||
| mqMessage.persistence = MQConstants.MQPER_PERSISTENT; | ||
| pmo.options = MQConstants.MQPMO_NO_SYNCPOINT | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add syncpoints and make these transactional, requiring a commit / rollback?
| } | ||
|
|
||
| void putMessage(MQQueue queue, String PRODUCER_PUT, String sampleMessage, Object object) { | ||
| throw new UnsupportedOperationException("Not supported yet."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a pull request with an unimplemented put?
| @@ -0,0 +1,11 @@ | |||
| com/ibm/mq/samples/java/BasicPub.class | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maven generated files should not be part of the pull request.
| @@ -0,0 +1,3 @@ | |||
| artifactId=base-mq-java | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maven generated files should not be in the git repo.
No description provided.