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

Parameterize Receiver and Listener types #710

Merged
merged 17 commits into from
Jun 12, 2020
Merged

Conversation

gvanbrakel
Copy link
Contributor

No description provided.

Copy link
Member

@nielsm5 nielsm5 left a comment

Choose a reason for hiding this comment

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

Wat als je van een jms naar een jdbc storage overgaat, is dan alles in je errorstorage verloren?

@@ -852,7 +852,7 @@ private void moveInProcessToError(String originalMessageId, String correlationId
}
}
if (errorStorage!=null) {
errorStorage.storeMessage(originalMessageId, correlationId, receivedDate, comments, null, sobj);
errorStorage.storeMessage(originalMessageId, correlationId, receivedDate, comments, null, (M)sobj);
Copy link
Member

Choose a reason for hiding this comment

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

Wat als sobj hier een MessageWrapper is?

@gvanbrakel
Copy link
Contributor Author

Er is een structuurprobleem, waardoor dat wat dit PR beoogt nu niet kan.
JmsBrowser implementeert IMessageBrowser, wat een basis interface van ITransactionalStorage is. In ITransactionalStorage kan die M van alles zijn, en die wordt dan ook in JmsTransactionalStorage verpakt in een javax.jms.ObjectMessage.
Maar JmsBrowser wordt ook gebruikt om (ruwe) javax.jms.messages van een queue te browsen. Dit twee toepassingen gebruiken dezelfde browse method, die gaat conflicteren als er stronger getyped wordt.
We moeten denk ik splitsen in een M browse() en een javax.jms.Message browseRaw()

@gvanbrakel gvanbrakel requested a review from nielsm5 June 2, 2020 11:48
* Basic browser of JMS Messages.
* @author Gerrit van Brakel
*/
public class JmsBrowser<M extends Message> extends JmsMessageBrowser<M,M> {
Copy link
Member

Choose a reason for hiding this comment

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

Misschien toch wel handig om ipv een import hier javax.jms.Message te gebruiken?

*/
public class JmsMessageBrowser extends JMSFacade implements IMessageBrowser {
public abstract class JmsMessageBrowser<M, J extends Message> extends JMSFacade implements IMessageBrowser<M> {
Copy link
Member

Choose a reason for hiding this comment

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

Wat is M en wat is J?

}

PipeLineSessionBase.setListenerParameters(context, null, correlationId, tsReceived, tsSent);
String messageId = (String) context.get("id");
return processMessageInAdapter(origin, message, message, messageId, correlationId, context, waitingTime, false);
return processMessageInAdapter(origin, (M)message, message, messageId, correlationId, context, waitingTime, false);
Copy link
Member

Choose a reason for hiding this comment

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

Je kan toch zomaar een string naar een M casten?

@@ -938,19 +938,19 @@ public void processRawMessage(IListener origin, Object rawMessage, Map threadCon

* Assumes that a transation has been started where necessary.
*/
private void processRawMessage(IListener origin, Object rawMessage, Map threadContext, long waitingDuration, boolean manualRetry) throws ListenerException {
private void processRawMessage(IListener<M> origin, Object rawMessage, Map<String,Object>threadContext, long waitingDuration, boolean manualRetry) throws ListenerException {
Copy link
Member

Choose a reason for hiding this comment

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

Moet rawmessage dan geen M zijn?

@gvanbrakel gvanbrakel requested a review from nielsm5 June 9, 2020 06:27
@gvanbrakel gvanbrakel marked this pull request as draft June 11, 2020 06:42
@gvanbrakel gvanbrakel marked this pull request as ready for review June 12, 2020 09:52
@nielsm5 nielsm5 merged commit 4528239 into master Jun 12, 2020
@nielsm5 nielsm5 deleted the ReceiverParametrization branch June 12, 2020 12:44
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.

2 participants