# How do I stream to a specific application instance?

**URL:** <https://community.wowza.com/t/how-do-i-stream-to-a-specific-application-instance/43931>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [July 27, 2016, 9:03am UTC](https://community.wowza.com/t/how-do-i-stream-to-a-specific-application-instance/43931 "2016-07-27T09:03:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim\_Houseman](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jim\_Houseman](https://community.wowza.com/u/Jim_Houseman)\
**Post date:** [July 27, 2016, 9:03am UTC](https://community.wowza.com/t/how-do-i-stream-to-a-specific-application-instance/43931/1 "2016-07-27T09:03:00Z")

</div>

I’m trying to programmatically republish a VOD stream to the “live” application of the same server.

I have this:

```auto
public void republishStream(String streamName) {
		getLogger().info("Republishing stream " + streamName + " "+ appInstance.getName());
		IVHost vhost = VHostSingleton.getInstance(VHost.VHOST_DEFAULT);
		vhost.startApplicationInstance("live", appInstance.getName());
		streamCopy = Stream.createInstance(vhost, "live/"+appInstance.getName(), "audio");
        if(streamCopy.play(streamName,delay,-1,false)){...

```

If I change this line:

```auto
Stream.createInstance(vhost, "live/"+appInstance.getName(), "audio");

```

To

```auto
Stream.createInstance(vhost, "live", "audio");

```

It’ll work, but I’d like to stream to something other than the “_definst_” channel.

How can I do this?

---

<div class="post-metadata">

**Author:** ![Jim\_Houseman](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jim\_Houseman](https://community.wowza.com/u/Jim_Houseman)\
**Post date:** [July 27, 2016, 9:10am UTC](https://community.wowza.com/t/how-do-i-stream-to-a-specific-application-instance/43931/2 "2016-07-27T09:10:56Z")

</div>

Oh, got it:

```auto
IVHost vhost = VHostSingleton.getInstance(VHost.VHOST_DEFAULT);
vhost.startApplicationInstance("live", appInstance.getName());
IApplication app = vhost.getApplication("live");
IApplicationInstance instance = app.getAppInstance(appInstance.getName());
streamCopy = Stream.createInstance(instance, "audio");

```

I hope this helps someone else in the future

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [August 9, 2016, 5:48am UTC](https://community.wowza.com/t/how-do-i-stream-to-a-specific-application-instance/43931/3 "2016-08-09T05:48:28Z")

</div>

Thank you for the update and for posting a solution. Glad you were able to sort this out.

Regards,

Salvadore
