Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
joram
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
joram
joram
Commits
282caa68
Commit
282caa68
authored
Jan 27, 2021
by
Andre Freyssinet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds correlation informations in logging to ease the message tracking.
parent
dc5ad0aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
12 deletions
+29
-12
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/AcquisitionModule.java
.../java/org/objectweb/joram/mom/dest/AcquisitionModule.java
+7
-6
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/Queue.java
...ore/src/main/java/org/objectweb/joram/mom/dest/Queue.java
+22
-6
No files found.
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/AcquisitionModule.java
View file @
282caa68
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2010 - 202
0
ScalAgent Distributed Technologies
* Copyright (C) 2010 - 202
1
ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -70,11 +70,9 @@ public class AcquisitionModule implements ReliableTransmitter {
clazz
=
clazz
.
getSuperclass
();
}
if
(
isDaemon
&&
isHandler
)
{
throw
new
Exception
(
"Acquisition class "
+
className
+
" can't implement both AcquisitionHandler and AcquisitionDaemon interfaces."
);
throw
new
Exception
(
"Acquisition class "
+
className
+
" can't implement both AcquisitionHandler and AcquisitionDaemon interfaces."
);
}
else
if
(!
isDaemon
&&
!
isHandler
)
{
throw
new
Exception
(
"Acquisition class "
+
className
+
" must implement either AcquisitionHandler or AcquisitionDaemon interface."
);
throw
new
Exception
(
"Acquisition class "
+
className
+
" must implement either AcquisitionHandler or AcquisitionDaemon interface."
);
}
}
...
...
@@ -147,8 +145,9 @@ public class AcquisitionModule implements ReliableTransmitter {
if
(
acquisitionHandler
instanceof
AcquisitionDaemon
)
{
isDaemon
=
true
;
}
setProperties
(
properties
);
// Creates and starts the AccquisitionModule.
setProperties
(
properties
);
}
catch
(
Exception
exc
)
{
logger
.
log
(
BasicLevel
.
ERROR
,
"AcquisitionModule: can't create acquisition handler."
,
exc
);
}
...
...
@@ -404,6 +403,8 @@ public class AcquisitionModule implements ReliableTransmitter {
for
(
Iterator
iterator
=
messages
.
iterator
();
iterator
.
hasNext
();)
{
Message
message
=
(
Message
)
iterator
.
next
();
if
((
message
.
getProperty
(
message
.
CORRELATION_ID
)
==
null
)
&&
(
message
.
id
!=
null
))
message
.
setProperty
(
message
.
CORRELATION_ID
,
message
.
id
);
message
.
id
=
"ID:"
+
destination
.
getDestinationId
()
+
'_'
+
msgCount
;
message
.
setDestination
(
destination
.
getId
().
toString
(),
destination
.
hasName
()?
destination
.
getName
():
null
,
...
...
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/Queue.java
View file @
282caa68
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 202
0
ScalAgent Distributed Technologies
* Copyright (C) 2001 - 202
1
ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 Dyade
*
* This library is free software; you can redistribute it and/or
...
...
@@ -949,9 +949,12 @@ public class Queue extends Destination implements QueueMBean {
if
(
logger
.
isLoggable
(
BasicLevel
.
DEBUG
))
logger
.
log
(
BasicLevel
.
DEBUG
,
"Message "
+
msgId
+
" acknowledged."
);
}
else
if
((
logger
.
isLoggable
(
BasicLevel
.
WARN
)
||
logmsg
.
isLoggable
(
BasicLevel
.
WARN
)))
{
logger
.
log
(
BasicLevel
.
WARN
,
"Message "
+
msgId
+
" not found for acknowledgement."
);
logmsg
.
log
(
BasicLevel
.
WARN
,
getName
()
+
": message "
+
msgId
+
" not found for acknowledgement."
);
}
else
{
if
((
logger
.
isLoggable
(
BasicLevel
.
WARN
)
||
logmsg
.
isLoggable
(
BasicLevel
.
WARN
)))
{
String
str
=
getName
()
+
": message "
+
msgId
+
" not found for acknowledgement."
;
logger
.
log
(
BasicLevel
.
WARN
,
str
);
logmsg
.
log
(
BasicLevel
.
WARN
,
str
);
}
}
}
...
...
@@ -1442,12 +1445,25 @@ public class Queue extends Destination implements QueueMBean {
receiving
=
false
;
}
private
static
final
String
getIdString
(
Message
msg
)
{
String
jmsCorrelationId
=
msg
.
getCorrelationId
();
Object
joramCorrelationId
=
msg
.
getMsg
().
getProperty
(
msg
.
getMsg
().
CORRELATION_ID
);
if
((
jmsCorrelationId
==
null
)
&&
(
joramCorrelationId
==
null
))
return
msg
.
getId
();
if
(
jmsCorrelationId
==
null
)
jmsCorrelationId
=
""
;
if
(
joramCorrelationId
==
null
)
joramCorrelationId
=
""
;
return
msg
.
getId
()
+
" ["
+
jmsCorrelationId
+
'/'
+
joramCorrelationId
+
"]"
;
}
void
addDeliveryTimeMessage
(
Message
msg
,
int
clientCtx
,
boolean
throwsExceptionOnFullDest
,
boolean
isHeader
)
throws
AccessException
{
if
(
logger
.
isLoggable
(
BasicLevel
.
DEBUG
))
logger
.
log
(
BasicLevel
.
DEBUG
,
"Queue.addDeliveryTimeMessage("
+
msg
+
", "
+
clientCtx
+
')'
);
if
(
logmsg
.
isLoggable
(
BasicLevel
.
INFO
))
logmsg
.
log
(
BasicLevel
.
INFO
,
getName
()
+
": gets new delayed message "
+
msg
.
getId
(
)
+
", "
+
msg
.
order
);
logmsg
.
log
(
BasicLevel
.
INFO
,
getName
()
+
": gets new delayed message "
+
getIdString
(
msg
)
+
", "
+
msg
.
order
);
// queue is full
if
(
nbMaxMsg
>
-
1
&&
nbMaxMsg
<=
(
messages
.
size
()
+
deliveryTable
.
size
()
+
getDelayedMessageCount
()))
{
...
...
@@ -1659,7 +1675,7 @@ public class Queue extends Destination implements QueueMBean {
protected
final
void
storeMessage
(
Message
msg
,
boolean
throwsExceptionOnFullDest
)
throws
AccessException
{
if
(
addMessage
(
msg
,
throwsExceptionOnFullDest
))
{
if
(
logmsg
.
isLoggable
(
BasicLevel
.
INFO
))
logmsg
.
log
(
BasicLevel
.
INFO
,
getName
()
+
": adds new message "
+
msg
.
getId
(
)
+
", "
+
msg
.
order
);
logmsg
.
log
(
BasicLevel
.
INFO
,
getName
()
+
": adds new message "
+
getIdString
(
msg
)
+
", "
+
msg
.
order
);
if
(
msg
.
isPersistent
())
{
// Persisting the message.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment