How use Http Polling ?

Hi,

I am tryin to use http polling like this :

I need to poll an URL by session.
One user user perform a login and get a session, launch the poller, it’s ok.
But in case of problem, the user logout, relogin and relaunch the poller for the new session.

The user need to stop the previous poller and start a new one, but it’s pretty difficult to achieve.

I try to use something like this :

exitBlockIfFail(exec(polling.pollerName(“heartbeatPolling”).every().exec(…)).exec(…)).exitBlockIfFail(polling.pollerName(“heartbeatPolling”).stop)

I get this sort of problems :

18:32:25.585 [ERROR] i.g.h.a.a.p.PollingStop - ‘pollingStop-4’ failed to execute: Could fetch poller actor: No attribute named ‘heartbeatPolling’ is defined
18:32:25.615 [ERROR] i.g.h.a.a.p.PollingStart - ‘heartbeatPolling-754’ crashed on session Session(ConsultationCarriereVolumineuse_doubleLooped,5,Map(RECHERCHER_BUTTON_ELT-PeriodeScope → 62, RECHERCHER_AUTRE_PARTICIPANT_BUTTON_ELT-PeriodeScope → 683, PERIODE_FROM_INPUT_ELT-SessionScope → 59, SYNC_ID_KEY-SessionScope → 3, VAADIN_PID_CHANGES-RequestScope → Vector(13, 46, 48, 36, 73, 81, 78, 69, 82, 24, 77, 72, 23, 68, 83, 59, 61), gatling.http.cache.dns → io.gatling.http.resolver.ShuffleJdkNameResolver@5419d717, gatling.http.cache.contentCache → io.gatling.core.util.cache.Cache@3238fc69, PERIODE_TO_INPUT_ELT-SessionScope → 61, 92942fb0-c8f1-48d4-a3de-b8eb567e3f48 → 1464625992919, timestamp.450e7bbd-8a42-48c8-9c6d-27cc8b7e7184 → 1464625934770, CSRF_TOKEN-SessionScope → c7eb792f-f6a1-4116-9c62-c98080cec2d5, AFFICHER_PERIODES_BUTTON_ELT-SessionScope → 49, VUIID_TOKEN-SessionScope → 1, VaadinBrowser → fr.dsirc.gatling.vaadin.browser2.FullVBStore@533b94ea, JAVA_SCRIPT_RPC_ELT-SessionScope → 14, CURRENT_TIMESTAMP-PollingScope → 1464625940575, timestamp.4fade11a-fa3d-4f4c-ae60-b2df1ce4f572 → 1464625934770, gatling.http.referer → http://rngd.retraite.aa/rechv-rngd-ihm/ConsultationCarriere, DISABLED_ELTS-SessionScope → Vector(59, 61, 62, 64, 68, 682, 69, 70, 72, 73, 74, 77, 78, 79, 81, 82, 83), 4fade11a-fa3d-4f4c-ae60-b2df1ce4f572 → 0, gatling.http.cookies → CookieJar(Map(CookieKey(jsessionid,rngd.retraite.aa,/rechv-rngd-ihm) → StoredCookie(JSESSIONID=Ul0BwqVfYziC+K6rQusFv99r.vhljbs6006.retraite.lan-hom2-tp03-01; path=/rechv-rngd-ihm,true,false,1464625934832))), INDIV_IDRC_INPUT_ELT-SessionScope → 48, CHECK_SUCCESS_COUNTER-PollingScope → Map(212c7f51-0805-40d2-ac80-6117874fec32 → 1, 01952b94-ef4f-42ca-85b2-351967ff2175 → 1, 0310dcc5-d1fe-4054-a23e-caa2cc5ed1a3 → 1), 450e7bbd-8a42-48c8-9c6d-27cc8b7e7184 → 0, POLLING_ID-SessionScope → 13),1464625934770,17,OK,List(GroupBlock(List(RNGD_100_02-XXX-Heartbeat-group),1464625945607,0,OK), TryMaxBlock(4fade11a-fa3d-4f4c-ae60-b2df1ce4f572,io.gatling.core.action.InnerTryMax@18ff273a,OK), ExitAsapLoopBlock(450e7bbd-8a42-48c8-9c6d-27cc8b7e7184,io.gatling.core.session.package$RichExpression$$$Lambda$155/532885071@2c4fa5d,io.gatling.core.action.InnerLoop@77ea95d8)),io.gatling.core.protocol.ProtocolComponentsRegistry$$Lambda$213/2014233765@278a7373), forwarding to the next one
akka.actor.InvalidActorNameException: actor name [heartbeatPolling-754-actor] is not unique!
at akka.actor.dungeon.ChildrenContainer$NormalChildrenContainer.reserve(ChildrenContainer.scala:129)
at akka.actor.dungeon.Children$class.reserveChild(Children.scala:130)
at akka.actor.ActorCell.reserveChild(ActorCell.scala:374)
at akka.actor.dungeon.Children$class.makeChild(Children.scala:268)
at akka.actor.dungeon.Children$class.attachChild(Children.scala:46)
at akka.actor.ActorCell.attachChild(ActorCell.scala:374)
at akka.actor.ActorSystemImpl.actorOf(ActorSystem.scala:589)
at io.gatling.http.action.async.polling.PollingStart.startPolling$1(PollingStart.scala:55)

The initial poller is created with the name “heartbeatPolling-754” and I cannot stop it.

How can I solve this ?

Many thanks.