Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
242 Chapter 10 Event Processing from the receiverUrl value in the event handler. The next thing to note is that the map may only consist of string values. The kicker does not perform any object morphing and will balk if not presented with all proper strings. Finally, we have the kick method itself. We’ve surrounded it by logger statements including timestamps. The kick method holds until the POST has either completed successfully or fails after the defined number of retries and delay times. Therefore, in theory at least, the kick method could take a fair amount of time to complete. The issue you. | 242 Chapter 10 Event Processing from the receiverUrl value in the event handler. The next thing to note is that the map may only consist of string values. The kicker does not perform any object morphing and will balk if not presented with all proper strings. Finally we have the kick method itself. We ve surrounded it by logger statements including timestamps. The kick method holds until the POST has either completed successfully or fails after the defined number of retries and delay times. Therefore in theory at least the kick method could take a fair amount of time to complete. The issue you could run into is that if your timer ticks occur faster than the kick method under failure retries you could easily end up with an ever-growing stack of kicks attempting to fire concurrently. As a general rule of thumb ensure that your timer tick delay is greater than the number of retries times the max retry delay time. This will keep you out of this sticky mess. Let s take a mental trip over to the receiving application for a moment forgetting that it s actually residing within the same application on this sample. As you can see in the kicker event configuration we are calling Zresources kickReceiver which in this sample is another groovy script shown in Listing 10.8. All we are doing here is dumping out the various parameters we received. Listing 10.8 resource kickReceiver.groovy def onCreate logger.INFO Got kicked by zget request params appName logger.INFO Parameters found zlist request params zlist request params false .each key - logger.INFO key zget request params key The log output is shown in Listing 10.9. We can see the two expected parameters that we supplied to the kick method but we also see two extra parameters that were provided that tell us the kicker and the application name that originated the kick. Listing 10.9 Log Output of app resources kickReceiver.groovy 2009-09-01 21 22 18 app.resources.kickReceiver.groovy onCreate Thread-2 INFO Got kicked by .