Open dakotahNorth opened 5 months ago
7434d5c8df
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
src/main/java/com/example/solace/springboot/starter/messaging/SolaceMessageListener.java
✓ https://github.com/dakotahNorth/solace-spring-boot-starter/commit/f89d1c553604812d2e3be5f06695ad5d05b860cd Edit
Modify src/main/java/com/example/solace/springboot/starter/messaging/SolaceMessageListener.java with contents:
• In the `connectToSolace(Config config)` method, add a conditional check to determine if the messaging mode is direct or guaranteed based on a new configuration property, e.g., `config.getString("solace.messagingMode")`.
• If the mode is direct, keep the existing session setup logic.
• If the mode is guaranteed, add the necessary logic to configure the session for guaranteed messaging. This may involve setting additional properties on the `JCSMPProperties` object or adjusting the session creation logic.
• Import any necessary classes for handling the guaranteed messaging configuration.
--- +++ @@ -141,13 +141,17 @@ private void connectToSolace(Config config) { JCSMPProperties properties = initializeConnectionProperties(config); + String messagingMode = config.getString("solace.messagingMode"); + if ("guaranteed".equals(messagingMode)) { + properties.setProperty(JCSMPProperties.REAPPLY_SUBSCRIPTIONS, true); // Enable reapplying subscriptions for guaranteed messaging + } if (checkLocalhost(properties)) { return; } establishSession(properties); subscribeToTopic(config); System.out.println("Connected to Solace."); -} + } private JCSMPProperties initializeConnectionProperties(Config config) { JCSMPProperties properties = new JCSMPProperties();
src/main/java/com/example/solace/springboot/starter/messaging/SolaceMessageListener.java
✓ Edit
Check src/main/java/com/example/solace/springboot/starter/messaging/SolaceMessageListener.java with contents:
Ran GitHub Actions for f89d1c553604812d2e3be5f06695ad5d05b860cd:
src/main/resources/application-dev.conf
✓ https://github.com/dakotahNorth/solace-spring-boot-starter/commit/425e6e88f774cedb6393dfaeeba0fdd8ac152edb Edit
Modify src/main/resources/application-dev.conf with contents:
• Add a new property `messagingMode` under the `solace` configuration block with possible values "direct" or "guaranteed". For example: `messagingMode = "direct"`.
• Add comments above the new property explaining the options for "direct" and "guaranteed" messaging modes.
--- +++ @@ -1,4 +1,8 @@ solace { + // messagingMode options: + // "direct" - for low-latency messaging without persistence. + // "guaranteed" - for reliable messaging with persistence. + messagingMode = "direct" host = "tcp://mr-connection-zw285jhb96b.messaging.solace.cloud:55555" clientUsername = "solace-cloud-client" clientPassword = "p2tkutqaru4pss6t9s00qh3qlo"
src/main/resources/application-dev.conf
✓ Edit
Check src/main/resources/application-dev.conf with contents:
Ran GitHub Actions for 425e6e88f774cedb6393dfaeeba0fdd8ac152edb:
README.md
✓ https://github.com/dakotahNorth/solace-spring-boot-starter/commit/79f5b0e766f00e2b7b03943593e8de76cf917615 Edit
Modify README.md with contents:
• Under the "Configure Solace Connection" section, add a new subsection titled "Configuring Messaging Mode".
• Explain that the messaging mode can be configured in the application.conf file using the `messagingMode` property with values "direct" or "guaranteed".
• Provide a brief description of when one might choose direct messaging over guaranteed messaging and vice versa.
• Mention that the default mode is "direct" if the property is not specified.
--- +++ @@ -26,6 +26,9 @@ ### Configure Solace Connection Create an application.conf file in your src/main/resources directory with the following Solace connection details: + +### Configuring Messaging Mode +The messaging mode can be configured in the application.conf file using the `messagingMode` property with values "direct" or "guaranteed". Direct messaging is suitable for scenarios requiring low latency without the need for message persistence. Guaranteed messaging, on the other hand, ensures reliable delivery at the cost of higher latency. The default mode is "direct" if the property is not specified. ```hocon
README.md
✓ Edit
Check README.md with contents:
Ran GitHub Actions for 79f5b0e766f00e2b7b03943593e8de76cf917615:
I have finished reviewing the code for completeness. I did not find errors for sweep/support_both_direct_and_guaranteed_throu
.
💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.
This is an automated message generated by Sweep AI.
Details
Support both direct and guaranteed messaging within SolaceMessageListener thru configuration settings.
Add the configuration settings to application.dev.conf.
Finish with application.dev.conf with guaranteed settings.
Update readme with instructions about setting up either direct or guaranteed.
Branch
No response
Checklist
- [X] Modify `src/main/java/com/example/solace/springboot/starter/messaging/SolaceMessageListener.java` ✓ https://github.com/dakotahNorth/solace-spring-boot-starter/commit/f89d1c553604812d2e3be5f06695ad5d05b860cd [Edit](https://github.com/dakotahNorth/solace-spring-boot-starter/edit/sweep/support_both_direct_and_guaranteed_throu/src/main/java/com/example/solace/springboot/starter/messaging/SolaceMessageListener.java) - [X] Running GitHub Actions for `src/main/java/com/example/solace/springboot/starter/messaging/SolaceMessageListener.java` ✓ [Edit](https://github.com/dakotahNorth/solace-spring-boot-starter/edit/sweep/support_both_direct_and_guaranteed_throu/src/main/java/com/example/solace/springboot/starter/messaging/SolaceMessageListener.java) - [X] Modify `src/main/resources/application-dev.conf` ✓ https://github.com/dakotahNorth/solace-spring-boot-starter/commit/425e6e88f774cedb6393dfaeeba0fdd8ac152edb [Edit](https://github.com/dakotahNorth/solace-spring-boot-starter/edit/sweep/support_both_direct_and_guaranteed_throu/src/main/resources/application-dev.conf) - [X] Running GitHub Actions for `src/main/resources/application-dev.conf` ✓ [Edit](https://github.com/dakotahNorth/solace-spring-boot-starter/edit/sweep/support_both_direct_and_guaranteed_throu/src/main/resources/application-dev.conf) - [X] Modify `README.md` ✓ https://github.com/dakotahNorth/solace-spring-boot-starter/commit/79f5b0e766f00e2b7b03943593e8de76cf917615 [Edit](https://github.com/dakotahNorth/solace-spring-boot-starter/edit/sweep/support_both_direct_and_guaranteed_throu/README.md) - [X] Running GitHub Actions for `README.md` ✓ [Edit](https://github.com/dakotahNorth/solace-spring-boot-starter/edit/sweep/support_both_direct_and_guaranteed_throu/README.md)