# API Question: IApplicationInstance.getStreams

**URL:** https://community.wowza.com/t/api-question-iapplicationinstance-getstreams/37385
**Category:** Wowza Developer Dojo
**Tags:** wowza-streaming-server-java-api
**Created:** [October 7, 2012, 9:05am UTC](https://community.wowza.com/t/api-question-iapplicationinstance-getstreams/37385 "2012-10-07T09:05:38Z")
**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: [October 7, 2012, 9:05am UTC](https://community.wowza.com/t/api-question-iapplicationinstance-getstreams/37385/1 "2012-10-07T09:05:38Z")

</div>

Does this method get just server-side streams, or any streams that has client connections, or something else? I am calling IApplicationInstance.getStreams(), then calling getStreams() on the result, and one of our source streams (inputs) appears to be returned twice. The API guide says “Get all the mediaStream objects attached to this applicationInstance”, so I need some clarification on this, if possible.

---

<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: [October 7, 2012, 8:13pm UTC](https://community.wowza.com/t/api-question-iapplicationinstance-getstreams/37385/2 "2012-10-07T20:13:27Z")

</div>

It returns all stream types. If there is a live stream named “myStream” and 1 client subscribed to that stream, this method would return both streams. If you just want published streams use IApplicationInstance.getPublishStreamNames()

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: [October 8, 2012, 11:32pm UTC](https://community.wowza.com/t/api-question-iapplicationinstance-getstreams/37385/3 "2012-10-08T23:32:22Z")

</div>

Yes it will include stream produced by the Wowza Transcoder. To get IMediaStream with stream name use IApplicationInstance().getStreams().getStream(streamName)

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: [October 8, 2012, 6:44am UTC](https://community.wowza.com/t/api-question-iapplicationinstance-getstreams/37385/4 "2012-10-08T06:44:31Z")

</div>

Thanks again, that’s exactly what I needed! Do you know if this will include all transcoded, based on transrate.xml? Secondly, Can you tell me how to get a IMediaStream object from the stream name? If I use getStreams to get a MediaStreamMap then I don’t see a method to get a published stream by name, so how do I ensure it’s the correct published stream if I just use getStream(String name)?

---

<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: [October 9, 2012, 7:07am UTC](https://community.wowza.com/t/api-question-iapplicationinstance-getstreams/37385/5 "2012-10-09T07:07:39Z")

</div>

Thanks for the info. I know of the existence of the getStream(String streamName) method, but am I guaranteed that the stream returned will be the published stream? The MediaStreamMap returned from getStreams returns all streams, including the non-published one, so:

IApplicationInstance.getStreams().getStream(publishedStreamName) does not seem like it always give me the published one, if there are client connections to that stream, although it seems to get the published stream in the testing I’ve done thus far.
