# Should onAppStart be getting called twice?

**URL:** <https://community.wowza.com/t/should-onappstart-be-getting-called-twice/37380>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [May 16, 2012, 10:50am UTC](https://community.wowza.com/t/should-onappstart-be-getting-called-twice/37380 "2012-05-16T10:50:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grant\_Keiser](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@Grant\_Keiser](https://community.wowza.com/u/Grant_Keiser)\
**Post date:** [May 16, 2012, 10:50am UTC](https://community.wowza.com/t/should-onappstart-be-getting-called-twice/37380/1 "2012-05-16T10:50:19Z")

</div>

I have a module using onAppStart, and this was always called once on our Wowza server using the live application. On an ec2 instance which uses the application type liverepeater-origin, the event is fired twice, once for the actual app name, and once for “_definst_”. Is this normal expected behavior? Also, are classes extending ModuleBase created only one time (singleton), or one time per application, so in this case twice?

Thanks,

Grant

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 16, 2012, 5:04pm UTC](https://community.wowza.com/t/should-onappstart-be-getting-called-twice/37380/2 "2012-05-16T17:04:33Z")

</div>

onAppStart fires each time an application instance is started. This is same on EC2 as any instance of Wowza. If you connect with each of the following, onAppStart will fire once for each:

rtmp://[wowza-server]:1935/vod/_definst_

rtmp://[wowza-server]:1935/vod/room1

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 16, 2012, 5:46pm UTC](https://community.wowza.com/t/should-onappstart-be-getting-called-twice/37380/3 "2012-05-16T17:46:50Z")

</div>

scratch

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 16, 2012, 6:11pm UTC](https://community.wowza.com/t/should-onappstart-be-getting-called-twice/37380/4 "2012-05-16T18:11:43Z")

</div>

Yes, sorry. And it was wrong anyway.

Richard

---

<div class="post-metadata">

**Author:** ![Grant\_Keiser](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@Grant\_Keiser](https://community.wowza.com/u/Grant_Keiser)\
**Post date:** [May 16, 2012, 11:59am UTC](https://community.wowza.com/t/should-onappstart-be-getting-called-twice/37380/5 "2012-05-16T11:59:00Z")

</div>

> Yes, with AES. Here are two methods:
> 
> [Secure HLS streams with external AES](https://www.wowza.com/docs/how-to-secure-apple-http-live-streaming-aes-128-external-method)
> 
> [Secure HLS streams with external AES](https://www.wowza.com/docs/how-to-use-the-internal-method-of-aes-128-encryption-to-secure-live-or-vod-streams-sent-to-apple-ios-devices-moduleencryptionhandlercupertinostreaming)
> 
> Richard

Was this post meant for another thread?
