# StreamName missing in function onMediaStreamCreate

**URL:** <https://community.wowza.com/t/streamname-missing-in-function-onmediastreamcreate/42017>\
**Category:** Wowza Streaming Engine\
**Created:** [July 25, 2014, 4:53pm UTC](https://community.wowza.com/t/streamname-missing-in-function-onmediastreamcreate/42017 "2014-07-25T16:53:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nineesh\_K\_Dasan](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@Nineesh\_K\_Dasan](https://community.wowza.com/u/Nineesh_K_Dasan)\
**Post date:** [July 25, 2014, 4:53pm UTC](https://community.wowza.com/t/streamname-missing-in-function-onmediastreamcreate/42017/1 "2014-07-25T16:53:15Z")

</div>

I have compiled a wowza class, say

[HTML]package com.vigileyes.wms.module;

import java.io.BufferedReader;

import java.io.DataOutputStream;

import java.io.InputStream;

import java.io.InputStreamReader;

import java.net.HttpURLConnection;

import java.net.URL;

import com.wowza.wms.logging.WMSLoggerFactory;

import com.wowza.wms.stream.IMediaStream;

import com.wowza.wms.stream.IMediaStreamNotify;

import com.wowza.wms.stream.IMediaStreamActionNotify;

public class MyMediaStreamListener implements IMediaStreamNotify, IMediaStreamActionNotify

{

@Override

public void onMediaStreamCreate(IMediaStream stream)

{

WMSLoggerFactory.getLogger(null).info("onMediaStreamCreate: " + stream.getName());

}

@Override

public void onMediaStreamDestroy(IMediaStream stream)

{

WMSLoggerFactory.getLogger(null).info("onMediaStreamCreate: " + stream.getName());

}

}[/HTML]

I am getting the stream name when the stream got destroyed. But it is missing in StreamCreate method.

Please help me.

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [July 25, 2014, 2:40pm UTC](https://community.wowza.com/t/streamname-missing-in-function-onmediastreamcreate/42017/2 "2014-07-25T14:40:17Z")

</div>

Hi,

The problem here is the call to onMediaStreamCreate is too early in the life of the stream to return a value. It would have to be returned after the stream is played or published, for example using the onPlay or onPublish methods [IMediaStreamActionNotify](https://www.wowza.com/resources/serverapi/com/wowza/wms/stream/IMediaStreamActionNotify.html).

Paul
