Samples for JCSMP use deprecated classes

I just faced today when looking at JCSMP samples for publishing e.g. to topic that samples
here:

+

to not get adapted to a latest version of library.
The JCSMPStreamingPublishEventHandler got deprecated and now points to use:
JCSMPStreamingPublishCorrelatingEventHandler

I recommend to verify and run your samples you provide towards latest version of libraries to detect usage of deprecated functionality. If found it should get replaced to avoid confusion.

Thanks for the heads up @Robert. We’ll be sure to take a look and get this resolved.

@marc many thanks. Have a nice week.

Hi @Robert . Yeah, during the GitHub repo migration where we were moving JCSMP samples due our new Java API, some of the older samples got copied over “as-is” and I didn’t go back and fix the deprecation issues.

If looking for a better topic publisher sample, start here: solace-samples-java-jcsmp/src/main/java/com/solace/samples/jcsmp/patterns/DirectPublisher.java at master · SolaceSamples/solace-samples-java-jcsmp · GitHub or solace-samples-java-jcsmp/src/main/java/com/solace/samples/jcsmp/patterns/GuaranteedPublisher.java at master · SolaceSamples/solace-samples-java-jcsmp · GitHub

Fixed the samples, and submitted a PR, if anyone wants to take a look at it: fixed deprecation warnings on older samples by aaron-613 · Pull Request #72 · SolaceSamples/solace-samples-java-jcsmp · GitHub

@Aaron Many thanks, that was for fixing the one issue. Can you bring up to have a process that this is done automatically. Meaning any solace sample should be tested automated towards new releases.
If deprecated usage is found it should pop up rewritten to new ways.

Like that you would never have samples which deviate from working with latest version of libs.

@Aaron As well consider not only GIT HUB. The same problem is on the hands on pages in solace it self. So as well here it makes use of deprecated classes.

JCSMPStreamingPublishCorrelatingEventHandler should have been made generic based on object type auto parsing.

@KumarAbhishek what do you mean? Generic how…? The JCSMPStreamingPublishCorrelatingEventHandler has been around for about 10 years, probably might have done things differently.
The new Java API has a dedicated class for correlating published Guaranteed messages: PersistentMessagePublisher.PublishReceipt (Solace PubSub+ Messaging API for Java 1.7.0 API)

@Aaron is the purpose of PersistentMessagePublisher and JCSMPStreamingPublishCorrelatingEventHandler   Same ?
My question was while using JCSMPStreamingPublishCorrelatingEventHandler   public void responseReceived instead of Object if we make Generic Java Generics then the parser would know what kind of binding is expected.