How to make apache Camel Quartz2 firenow to work consistently - apache-camel

I am using Quartz2 which is bundled in apache camel 2.23.2. I am using the "fireNow" feature to trigger the job immediately after the deployment. but it doesn't work consistently.
Sometimes it gets triggered after a long time, and some time it doesn't get triggered.
The problem doesn't occur very frequently. i tried enabling the logs to figure out whats going on. i didn't see any error message. only difference what i found between working and non working job is the order in which Consumer is invoked
Working Logs
org.apache.camel.component.quartz2.QuartzComponent##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Setting org.quartz.scheduler.jmx.export=true to ensure QuartzScheduler(s) will be enlisted in JMX.| org.apache.camel.component.quartz2.QuartzComponent##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Creating SchedulerFactory: 1557418314584-Timer_Issue with properties: {org.quartz.scheduler.jmx.export=true, org.quartz.scheduler.skipUpdateCheck=true, org.quartz.scheduler.instanceName=1557418314584-Timer_Issue, org.terracotta.quartz.skipUpdateCheck=true, org.quartz.threadPool.threadCount=1}| org.apache.camel.component.quartz2.QuartzComponent##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Create and initializing scheduler.| org.apache.camel.component.quartz2.QuartzComponent##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Storing camelContextName=Timer_Issue into Quartz Context space.| org.apache.camel.component.quartz2.QuartzEndpoint##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Creating new CamelJob.| org.apache.camel.component.quartz2.QuartzEndpoint##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Created jobDetail=JobDetail 'Camel_Timer_Issue.TimerIssueTimerEventDefinition3719721': jobClass: 'org.apache.camel.component.quartz2.CamelJob concurrentExectionDisallowed: false persistJobDataAfterExecution: false isDurable: false requestsRecovers: false| org.apache.camel.component.quartz2.QuartzEndpoint##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Creating SimpleTrigger.| org.apache.camel.component.quartz2.QuartzEndpoint##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Setting user extra triggerParameters {repeatCount=0, repeatInterval=0}| org.apache.camel.component.quartz2.QuartzEndpoint##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Created trigger=Trigger 'Camel_Timer_Issue.TimerIssueTimerEventDefinition3719721': triggerClass: 'org.quartz.impl.triggers.SimpleTriggerImpl calendar: 'null' misfireInstruction: 1 nextFireTime: null| org.apache.camel.component.quartz2.QuartzHelper##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Adding camelContextName=Timer_Issue, endpointUri=quartz2://TimerIssueTimerEventDefinition3719721?fireNow=true&trigger.repeatCount=0&trigger.repeatInterval=0 into job data map.| org.apache.camel.component.quartz2.QuartzEndpoint##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Job Camel_Timer_Issue.TimerIssueTimerEventDefinition3719721 (triggerType=SimpleTriggerImpl, jobClass=CamelJob) is scheduled. Next fire date is Thu May 09 16:11:56 UTC 2019| org.apache.camel.component.quartz2.QuartzComponent##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Storing camelContextName=Timer_Issue into Quartz Context space.|
"
org.apache.camel.component.quartz2.QuartzComponent##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Starting scheduler.| org.apache.camel.component.quartz2.QuartzConsumer##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Starting consumer: Consumer[quartz2://TimerIssueTimerEventDefinition3719721?fireNow=true&trigger.repeatCount=0&trigger.repeatInterval=0]| org.apache.camel.component.quartz2.CamelJob##anonymous#1557418314584-Timer_Issue_Worker-1####na#na#na#na#Running CamelJob jobExecutionContext=JobExecutionContext: trigger: 'Camel_Timer_Issue.TimerIssueTimerEventDefinition3719721 job: Camel_Timer_Issue.TimerIssueTimerEventDefinition3719721 fireTime: 'Thu May 09 16:11:56 UTC 2019 scheduledFireTime: Thu May 09 16:11:56 UTC 2019 previousFireTime: 'null nextFireTime: null isRecovering: false refireCount: 0| org.apache.camel.component.quartz2.CamelJob##anonymous#1557418314584-Timer_Issue_Worker-1####na#na#na#na#Looking up existing QuartzEndpoint with triggerKey=Camel_Timer_Issue.TimerIssueTimerEventDefinition3719721|
"
Not Working Log
INFO#org.apache.camel.component.quartz2.QuartzComponent##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Setting org.quartz.scheduler.jmx.export=true to ensure QuartzScheduler(s) will be enlisted in JMX.| DEBUG#org.apache.camel.component.quartz2.QuartzComponent##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Creating SchedulerFactory: 1557418506499-Timer_Issue with properties: {org.quartz.scheduler.jmx.export=true, org.quartz.scheduler.skipUpdateCheck=true, org.quartz.scheduler.instanceName=1557418506499-Timer_Issue, org.terracotta.quartz.skipUpdateCheck=true, org.quartz.threadPool.threadCount=1}| INFO#org.apache.camel.component.quartz2.QuartzComponent##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Create and initializing scheduler.| org.apache.camel.component.quartz2.QuartzComponent##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Storing camelContextName=Timer_Issue into Quartz Context space.| org.apache.camel.component.quartz2.QuartzEndpoint##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Creating new CamelJob.| org.apache.camel.component.quartz2.QuartzEndpoint##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Created jobDetail=JobDetail 'Camel_Timer_Issue.TimerIssueTimerEventDefinition3719721': jobClass: 'org.apache.camel.component.quartz2.CamelJob concurrentExectionDisallowed: false persistJobDataAfterExecution: false isDurable: false requestsRecovers: false| org.apache.camel.component.quartz2.QuartzEndpoint##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Creating SimpleTrigger.| org.apache.camel.component.quartz2.QuartzEndpoint##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Setting user extra triggerParameters {repeatCount=0, repeatInterval=0}| org.apache.camel.component.quartz2.QuartzEndpoint##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Created trigger=Trigger 'Camel_Timer_Issue.TimerIssueTimerEventDefinition3719721': triggerClass: 'org.quartz.impl.triggers.SimpleTriggerImpl calendar: 'null' misfireInstruction: 1 nextFireTime: null| org.apache.camel.component.quartz2.QuartzHelper##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Adding camelContextName=Timer_Issue, endpointUri=quartz2://TimerIssueTimerEventDefinition3719721?fireNow=true&trigger.repeatCount=0&trigger.repeatInterval=0 into job data map.| org.apache.camel.component.quartz2.QuartzEndpoint##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Job Camel_Timer_Issue.TimerIssueTimerEventDefinition3719721 (triggerType=SimpleTriggerImpl, jobClass=CamelJob) is scheduled. Next fire date is Thu May 09 16:15:07 UTC 2019| org.apache.camel.component.quartz2.QuartzComponent##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Storing camelContextName=Timer_Issue into Quartz Context space.|
"
org.apache.camel.component.quartz2.QuartzComponent##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Starting scheduler.| org.apache.camel.component.quartz2.CamelJob##anonymous#1557418506499-Timer_Issue_Worker-1####na#na#na#na#Running CamelJob jobExecutionContext=JobExecutionContext: trigger: 'Camel_Timer_Issue.TimerIssueTimerEventDefinition3719721 job: Camel_Timer_Issue.TimerIssueTimerEventDefinition3719721 fireTime: 'Thu May 09 16:15:07 UTC 2019 scheduledFireTime: Thu May 09 16:15:07 UTC 2019 previousFireTime: 'null nextFireTime: null isRecovering: false refireCount: 0| org.apache.camel.component.quartz2.CamelJob##anonymous#1557418506499-Timer_Issue_Worker-1####na#na#na#na#Looking up existing QuartzEndpoint with triggerKey=Camel_Timer_Issue.TimerIssueTimerEventDefinition3719721| org.apache.camel.component.quartz2.QuartzConsumer##anonymous#Blueprint Event Dispatcher: 1####na#na#na#na#Starting consumer: Consumer[quartz2://TimerIssueTimerEventDefinition3719721?fireNow=true&trigger.repeatCount=0&trigger.repeatInterval=0]|
"
I have highlighted the difference in bold. Looks like the CamelJob gets triggered even before Consumer starts.

Related

Salesforce lwc lightning/modal dispatchEvent

Documentation - https://developer.salesforce.com/docs/component-library/bundle/lightning-modal/documentation - modal - API 56
When I try to fire an event from the modal window to the parent window - completely according to the example from the documentation - I get an error -
Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
Completely according to the example from the documentation
this.dispatchEvent(new CustomEvent('select', {
detail: {
id: 42
}
}));
The error occurs even at the moment the event is sent - not to mention the moment it is received
I'm waiting for an event but it doesn't happen
You have to enable Lightning Web Security Enabled in the org to get this working.
You can check this https://salesforce.stackexchange.com/questions/387924/lightning-modal-custom-event-not-working-in-winter-23-release
I've checked it myself and it's working well.

ical4j: add organizer who is able to cancel an event?

I am using ical4j to send out emails with a calendar attachment. I am able to add an organizer based on this SO post: How should I use iCal4j to add a meeting organizer to an iCal event
event.getProperties().add(new Organizer("mailto:bob#example.com"));
The problem is that no attendees added to the calendar is able to cancel an event. If I create (manually, no ical4j) an calendar appointment in Outlook Online, I am able to cancel an event as shown below:
However, the email with an ical4j attachment I received as the organizer (see the above code example) only gives me three options: Yes, No, Maybe as shown below:
How can I make someone among an meeting's attendees be able to cancel the meeting?
------- Update 11/15 -------
Based on the suggestion from #fortuna, my program generated the following event. I am still unable to cancel an event.
BEGIN:VCALENDAR
PRODID:-//Events Calendar//iCal4j 3.0.1//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTAMP:20211115T144506Z
DTSTART;TZID=America/New_York:20211215T110000
DTEND;TZID=America/New_York:20211215T114500
SUMMARY:ABC123 School
TZID:America/New_York
LOCATION:Virtual
UID:153ab747-bbd2-4964-9112-9fa0d29ed306
STATUS:CONFIRMED
ORGANIZER;ROLE=CHAIR:mailto:dev1#example.com
ATTENDEE;ROLE=REQ-PARTICIPANT:mailto:dev2#example.com
ATTENDEE;ROLE=REQ-PARTICIPANT:mailto:dev1#gmail.com
END:VEVENT
END:VCALENDAR
I manually generated an event in Outlook Online and forwarded it to my yahoo account to get the calendar attachment:
BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Eastern Standard Time
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER;CN="dev1":mailto:dev1#example.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=dev2
g:mailto:dev2#yahoo.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="dev3"
:mailto:dev3#example.com
DESCRIPTION;LANGUAGE=en-US:\n\n\n________________________________________\n
From: dev1 <dev1#example.com>\nSent: Monday\, November 15\, 2021 8:5
2:23 AM (UTC-05:00) Eastern Time (US & Canada)\nTo: dev3\; dev1\,
\nSubject: test\, please ignore it.\nWhen: Monday\, N
ovember 22\, 2021 10:30 AM-11:00 AM.\nWhere:\n\ntest\n\n__________________
______________________________________________________________\nMicrosoft
Teams meeting\nJoin on your computer or mobile app\nClick here to join the
.....
cdd5fc5d11c&threadId=19_meeting_OGYzZjAdddxMjYtYYy00ZDE4LWE0NjctZjY4OTA0ZG
I0ZTQ4#thread.v2&messageId=0&language=en-US>\n____________________________
____________________________________________________\n
UID:040000008200E00074C5B7101A82E00800000000933C540328DAD701000000000000000
0100000001771BBC5CAD45B499CBF167EE077185B
SUMMARY;LANGUAGE=en-US:FW: another test for GRD\, please ignore it.
DTSTART;TZID=Eastern Standard Time:20211122T103000
DTEND;TZID=Eastern Standard Time:20211122T110000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20211115T135223Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION;LANGUAGE=en-US:
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-OWNERAPPTID:2119924365
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-ONLINEMEETINGINFORMATION:{"OnlineMeetingChannelId":null\,"Onlin
eMeetingProvider":3}
X-MICROSOFT-ONLINEMEETINGTOLLNUMBER:+1 571-429-6038
X-MICROSOFT-ONLINEMEETINGCONFERENCEID:475654328
X-MICROSOFT-SKYPETEAMSMEETINGURL:https://teams.microsoft.com/l/meetup-join/
19%3ameeting_OGYzZjAxMjYtYzFlYy00ZDE4LWE0NjctZjY4OTA0ZGI0ZTQ4%40thread.v2/
0?context=%7b%22Tid%22%3a989b5e2ddda-14e4-4efe-93b7-8cdd5fc5d11c%22%2c%22O
id%22%3a%2256f6a1be-b722-47fd-b69c-5950f281818f%22%7d
X-MICROSOFT-SCHEDULINGSERVICEUPDATEURL:https://api.scheduler.teams.microsof
t.com/teams/989b5e2a-14e4-4efe-9ddd5fsasdfc5d11c/56f6a1be-b722-47fd-b69c-5
950f281818f/19_meeting_OGYzZjddYtYzFl4Ysa00ZDE4LWE0NjctZjY4OTA0ZGI0ZTQ4#th
read.v2/0
X-MICROSOFT-SKYPETEAMSPROPERTIES:{"cid":"19:meeting_OGYzZjAxMjYtYzFlYy00ZDE
4LWE0NjctZjY4OTA0ZGI0ZTQ4#thread.v2"\,"rid":0\,"mid":0\,"uid":null\,"priva
te":true\,"type":0}
X-MICROSOFT-ONLINEMEETINGCONFLINK:conf:sip:dev1#example.com\;gruu\;opaque=app:
conf:focus:id:teams:2:0!19:meeting_OGYzZxAxMjYtdasYzFlYy00Z4LWE0NjctZjY4OTA
0ZGI0ZTQ4-thread.v2!56f6a1beb72247fdb69c5818dasdfsadf!989b5e2a14e44efe93b78
cdd5fc5d11c
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
X-MICROSOFT-LOCATIONS:[]
BEGIN:VALARM
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR
I suspect you may need to add something like a participation role to your organizer property:
https://datatracker.ietf.org/doc/html/rfc5545#section-3.2.16
e.g. ORGANIZER;ROLE=CHAIR:bob#example.com
Another way to find out how Outlook does it is to forward the event "as icalendar" to another email address and inspect the ".ics" attachment.

Still waiting for shutdown of 1 message listener invokers

I have an apache-camel JMS route.
form("jms:queue:sourceQueue").to("messageProcessor")
My requirement is to stop route on 3 message processing failures. In messageProcessor class, in catch block I am checking for error count and as soon as it reaches 3, I am inovking
camelContext.stopRoute(routeID, 3, TimeUnit.SECONDS);
My route do not stop and spring's DefaultMessageListenerContainer writes following line in log
Shutting down JMS listener container
Waiting for shutdown of message listener invokers
Still waiting for shutdown of 1 message listener invokers
I am trying to figure out, what is holding DMLC from stopping?
What camel attribute I am missing?
If I use asyncStopListener=true then camle route stops but a thread keeps waiting in background to stop listener.
Are you stopping a route from a route? eg if you do that in the
processor, then see this FAQ
http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html

icalendar two and more events together via JavaMail

I tried to put two events together in one ICS. To do this I helped an example put on this forum:
(...)
BEGIN:VCALENDAR
PRODID:-//bobbin v0.1//NONSGML iCal Writer//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
DTSTART:20100701T080000Z
DTEND:20100701T110000Z
DTSTAMP:20091130T213238Z
UID:1285935469767a7c7c1a9b3f0df8003a#yoursever.com
CREATED:20091130T213238Z
DESCRIPTION:Example event 1
LAST-MODIFIED:20091130T213238Z
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Example event 1
TRANSP:OPAQUE
END:VEVENT
BEGIN:VEVENT
DTSTART:20100701T120000Z
DTEND:20100701T130000Z
DTSTAMP:20091130T213238Z
UID:1285935469767a7c7c1a9b3f0df8003b#yoursever.com
CREATED:20091130T213238Z
DESCRIPTION:Example event 2
LAST-MODIFIED:20091130T213238Z
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Example event 2
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
(...)
The result was that the invitation noticed inside the calendar only first event, the second was omitted.
What was wrong?
I observed the same result in Outlook and Gmail.
if you want to import many events :
To gmail , you could implement the api of gmail calendar ,
To outlook , you can alter the icalendar method to "publish" , and it would create new calendar , the new calendar will include many events
if you send just an appointment , that would not be a problem , but if you have many appointments, it would be a problem , because its weird if you include many events in an email or you send per appointment per mail

All-day event in Lotus Notes using iCalendar

I am trying to create an .ics file that can be used to import all-day events.
I'm using the following code in the .ics file:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:uid1#example.com
DTSTAMP:19970714T170000Z
ORGANIZER;CN=John Doe:MAILTO:john.doe#example.com
DTSTART;TSID="GMT":20110719T040000
DTEND;TSID="GMT":20110719T200000
TRANSP:OPAQUE
SUMMARY:Holiday
X-LOTUS-UPDATE-SEQ:1
X-LOTUS-NOTESVERSION:2
X-LOTUS-APPTTYPE:2
END:VEVENT
END:VCALENDAR
I exported a test all-day event, so I could check the formatting, but it still does not display in the top panel as an all-day event.
Does anyone know how to get an event to appear as an all-day event in Lotus Notes?
The correct solution was to remove the time from the DTSTART and DTEND e.g.
DTSTART;TSID="GMT":20110719T040000 ==> DTSTART;TSID="GMT":20110719
Hope this helps some people.
This is a working example:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//innerjoin.org/NONSGML Innerjoin iCal Test Case Gen 20050301//EN
BEGIN:VEVENT
UID:20050301-96412-innerjoin-org
DTSTART;VALUE=DATE:20050301
DTEND;VALUE=DATE:20050302
DTSTAMP:20050301
URL:
http://www.innerjoin.org/iCalendar/test-cases/20050301-20050302.txt
SUMMARY:
Event from 20050301 to 20050302
DESCRIPTION:
Event starting at 20050301 and lasting until 20050302\n
- Option: Starting on 20050301\n
- Option: Ending on 20050302\n
- Default: No timezone specified\, using local time\n
- Default: No status given\, not necessarily confirmed\n
- Default: No class given\, treat event details as publicly accessible\n
- Default: Event treated as opaque
END:VEVENT
END:VCALENDAR

Resources