Skip to content

Conversation

@Hannah-Jones997
Copy link
Collaborator

No description provided.

@CLAassistant
Copy link

CLAassistant commented Oct 23, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@chughts chughts left a 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" \
Copy link
Collaborator

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 @@
{
Copy link
Collaborator

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());
Copy link
Collaborator

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) {
Copy link
Collaborator

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());
Copy link
Collaborator

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 |
Copy link
Collaborator

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.");
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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.

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.

4 participants