Distributing 1 Stream (Channel) to 2 Destinations

I want to distribute one stream to 2 destinations. For example the incoming flow from some Web Browser to the Web Server to be split to the Web Browser and Another user stream like "System.out".
What is better way to do this:
1. Using "java.io.*" classes or using "java.nio.*" classes;
2. Using Pipe or standard way. If Pipe is better choice how to do that. I am not so familiar with Pipes.
Can I find some working examples with similar functionallity?

You can implement something like this :
import java.io.*;
public class DoubleStream extends InputStream {
  Vector outputs = new Vector(2);
  public DoubleStream(InputStream source) {
    super(source);
  public int read() throws IOException {
    int data = super.read();
    for(int i=outputs.size(); i-->0; )  ((OutputStream)outputs.get(i)).write(data);
    return data;
  public void addOutput(OutputStream os) {  outputs.add(os);  }
}of course may be you will also need some exception handling, EOS handling etc... But this is like direction where to move on...

Similar Messages

  • BlazeDS with WAS 6.1 streaming channel killing the server?

    Hi,
    We are experiencing a strange issue with WAS (websphere server) 6.1 with BlazeDS
    after a while severe performance degrades and then system hungs shortly after
    Some prelimenary observations:
    we are seeing following errors in Server Log:
    [6/22/10 16:41:26:828 EDT] 000000b0 ThreadMonitor W   WSVR0605W: Thread "WebContainer : 3-in-streaming-mode" (0000002a) has been active for 656127 milliseconds and may be hung.  There is/are 1 thread(s) in total in the server that may be hung.
    [6/22/10 16:48:00:144 EDT] 000000b1 ThreadMonitor W   WSVR0605W: Thread "WebContainer : 0" (00000027) has been active for 753457 milliseconds and may be hung.  There is/are 2 thread(s) in total in the server that may be hung.
    We do see that there is always one active connection maintained betweeb browser and server(which is connected to ):
    messagebroker/streamingamf
    and  that keeps sending keep-alive signals , now is this a reason we are getting hung messages? can we safely ingore it?
    basically can streaming chanell cause that error? and what would be suggestions tweaks/modifications to fix that issue?
    our destination config :
    <destination id="alerts-Push-jms" >
            <properties>
                <jms>
                    <destination-type>Topic</destination-type>
                    <message-type>javax.jms.TextMessage</message-type>
                    <connection-factory>jms/***JMSTopicConnectionFactory</connection-factory>
                    <destination-jndi-name>jms/AlertEventingTopic</destination-jndi-name>
                    <delivery-mode>PERSISTENT</delivery-mode>
                    <message-priority>DEFAULT_PRIORITY</message-priority>
                    <preserve-jms-headers>"true"</preserve-jms-headers>
                    <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
                    <max-producers>1</max-producers>
                </jms>
            </properties>
            <adapter ref="jms" />
        <channels>
            <channel ref="my-streaming-amf" />
        </channels>
        </destination>

    Actually we did not fix it from WAS perspective, but what we did is ditched a blazeds streaming channel in favor of polling channel,
    that solved the issue.
    it appears that WAS has issues with connections that are Held open for a long time.

  • [svn] 1774: Bug: BLZ-176 - Not getting an authentication error when Producer tries to send a message over streaming channel with insufficient credentials .

    Revision: 1774
    Author: [email protected]
    Date: 2008-05-16 13:29:10 -0700 (Fri, 16 May 2008)
    Log Message:
    Bug: BLZ-176 - Not getting an authentication error when Producer tries to send a message over streaming channel with insufficient credentials.
    QA: Yes
    Doc: No
    Checkintests: Pass
    Details: This was caused by the fact that streaming channels do not report connected until the initial ping completes and a URLStream is established with the server. Added some extra code in ChannelSet to make sure authentication errors are reported with correct faultCode even if the channel is not reporting connected.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-176
    Modified Paths:
    flex/sdk/branches/3.0.1.x/frameworks/projects/rpc/src/mx/messaging/ChannelSet.as

    Revision: 1774
    Author: [email protected]
    Date: 2008-05-16 13:29:10 -0700 (Fri, 16 May 2008)
    Log Message:
    Bug: BLZ-176 - Not getting an authentication error when Producer tries to send a message over streaming channel with insufficient credentials.
    QA: Yes
    Doc: No
    Checkintests: Pass
    Details: This was caused by the fact that streaming channels do not report connected until the initial ping completes and a URLStream is established with the server. Added some extra code in ChannelSet to make sure authentication errors are reported with correct faultCode even if the channel is not reporting connected.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-176
    Modified Paths:
    flex/sdk/branches/3.0.1.x/frameworks/projects/rpc/src/mx/messaging/ChannelSet.as

  • No Packages for Streaming Channels only?

    I have FIOS Internet service only and have ditched the Verizon Router almost 2 years ago.  At the time, the provided routers did not provide Gigabit ports and the wireless was not great IMO.  I have no desire to reconnect this router or watch live TV on a regular basis.  Got rid of DirecTV and use Netflix and HuluPlus for TV content.  On the rare occasion I wanted to watch AMC for Walking Dead as it played live, I wanted to use the FIOS App on my XBox 360 and XBox One.  I was told I needed to subscribe to one of the full TV packages to get any of the streaming channels.  Maybe I'm the minority here, but feel Verizon is missing out on a subscriber base.
    Any ideas?

    WilliamIII wrote:
    I have FIOS Internet service only and have ditched the Verizon Router almost 2 years ago.  At the time, the provided routers did not provide Gigabit ports and the wireless was not great IMO.  I have no desire to reconnect this router or watch live TV on a regular basis.  Got rid of DirecTV and use Netflix and HuluPlus for TV content.  On the rare occasion I wanted to watch AMC for Walking Dead as it played live, I wanted to use the FIOS App on my XBox 360 and XBox One.  I was told I needed to subscribe to one of the full TV packages to get any of the streaming channels.  Maybe I'm the minority here, but feel Verizon is missing out on a subscriber base.
    Any ideas?
    A lot of your content providers with channels who offer streaming media through their websites or apps require a subscription from a cable provider, it's not just a Fios thing. Because of contracts with cable providers to carry the channels they aren't just going to allow you to watch their content without paying for some kind of subscription.
    Hulu, Netflix, etc. run their own paid subscription services which is why you can view their content however you want, but if you want to watch cable shows outside of those services that aren't on them, you are going to have to subscribe elsewhere.
    You can get local channel streaming such as ABC, CBS, etc. for free through their apps, but if it's a cable channel one way or another you're going to pay if you want what's offered.

  • [svn:bz-trunk] 14143: Should have happened long time ago but deprecated idle-timeout-minutes in Servlet-based streaming channels and introduced connection-idle-timeout-minutes .

    Revision: 14143
    Revision: 14143
    Author:   [email protected]
    Date:     2010-02-12 05:30:48 -0800 (Fri, 12 Feb 2010)
    Log Message:
    Should have happened long time ago but deprecated idle-timeout-minutes in Servlet-based streaming channels and introduced connection-idle-timeout-minutes. This way both Servlet-based and NIO-based channels have consistent timeout config.
    QA: No - I already tested.
    Doc: Yes - If we have references to idle-timeout-minutes in the doc, should be changed to connection-idle-timeout-minutes.
    Checkintests: Pass
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/endpoints/BaseStreamingHTTPEndpoint.java
        blazeds/trunk/resources/config/services-config.xml

    ls -l /var/run/lighttpd/
    And how are you spawning the php instances? I don't see that in the daemons array anywhere.
    EDIT: It looks like the info in that page is no longer using pre-spawned instances, but lighttpd adaptive-spawn. The documentation has been made inconsistent it looks like.
    You will note that with pre-spawned information, the config looks different[1].
    You need to do one or the other, not both (eg. choose adaptive-spawn, or pre-spawn..not both).
    [1]: http://wiki.archlinux.org/index.php?tit … oldid=8051 "change"

  • Proxy receiver channel with HTTP destination or URL address?

    Hi Experts,
         I have a scenario as below:
         (Webservice Client)SOAP --> PI --> PROXY(SAP ECC).
         A webservice client calls PI using SOAP. PI then sends the request to SAP ECC using PROXY.
        I am using AAE. Therefore I have ICO.
        In the receiver PROXY channel I have given:
       ADAPTER TYPE: SOAP
       Transport Protocol: HTTP
       Message Protocol: XI3.0.
       Under connection parameters:
       Addressing Type dropdown as 2 entries HTTP destination and URL address.
       In what cases i should use HTTP destination and URL address respectively?
       Which option is preferred?
       Do they work same or differently? How?   
       When I select HTTP destination where should I create the corresponding RFC destination? In PI ABAP stack using SM59 or PI NWA?
       If this HTTP destination is created in PI ABAP stack using SM59 then what type it should be? H? or G? 
    Thanks
    Gopal

    Hi Gopal,
    In creating XI receiver communication channel, you have 2 options for Addressing Type:
    1. URL Address - no need to create RFC destination. You just have to specify the XI receiver host name, HTTP port, path (/sap/xi/engine?type=receiver), Authentication data (logon details for SAP Client number of the PI system).
    2. HTTP Destination - create RFC destination in SXMB_ADM and specify the RFC destination name in your receiver communication channel.
    For SAP documentation, see this link:
    http://help.sap.com/saphelp_nwpi711/helpdata/en/f4/0a1640a991c742e10000000a1550b0/content.htm?frameset=/en/e1/091640a991c742e10000000a1550b0/frameset.htm&current_toc=/en/43/96cbccb9335b77e10000000a11466f/plain.htm&node_id=5
    Regards,
    Naveen.

  • Stream/Channel in memory; C# MemoryStream equivalent?

    Alright, I've tried to do my homework before posting this question, so bear with me. I'm coming from more of a C++ and C# background... I've only been pecking away at Java for 2-3 months.
    In C#, Stream is an abstract class inherited by MemoryStream, FileStream, and NetworkStream... maybe even some others, who knows. These Streams allow you to read/write data without any concern for allocation. Very cool.
    I've explored java.io.* and java.nio.* and I haven't seen anything that seems to be the equivalent of C#'s MemoryStream. Everything seems to either be file-based or have a static capacity (which I get to declare, but still).
    I'm working with C library that I've been JNI-ing for a while here and am now trying to allow the Java devs at my company to interface with the files it manipulates without using the disk. What I mean is that by default, the C library reads and writes based on ANSI paths, which is pretty standard. I'm trying to extend it by allowing them to work completely from memory. We do a lot of processing and if I can keep the disk out of the equation, our work will go that much more quickly.
    To accomplish this, I'm going to let them pass me a ByteBuffer, or a Channel, or InputStream and OutputStream... or... see, that's where I get lost. Which one? Or some other? I originally started on ByteBuffer, until I realized that the capacity is solid once I create it. The C library needs to write data out sometimes, and if I run out of space in my ByteBuffer, what then? Allocate a new, larger ByteBuffer, copy the old into the new, and move on? Seems clunky. There has to be a better way. I figure I can't be the only person who has ever needed this kind of functionality.
    Any guidance you can provide would be highly appreciated!

    Have a look at ByteArrayInputStream and ByteArrayOutputStream for analogues to C#'s MemoryStream.
    ~

  • Distributing WebI reports to  BO inbox Destinations via 'Send To' Feature

    I'm on BOE XI3.1 and I need to allow users to distribute WebI reports from their favorites to other user BO inboxes via the 'Send To' feature. All works fine but the sent reports doesn't get delivered to the selected destination. It ends up in the Temporary Storage with a 'failed' status 
    ie. recipient error. [[CrystalEnterprise.Managed] ([1]/[1])]: [bobj1]
    I followed the instructions from this forum thread granting the user rights specified but without success
    http://www.forumtopics.com/busobj/viewtopic.php?t=138015&highlight=inbox+destination
    Is there documented notes on how to grant the correct user/oject rights to enable this functionality to work? My users only have 'View on Demand' to public folders. A user with Administrator rights can send reports to inboxes without any problems.
    Can anyone help?

    Thanks Hensen for the lead.
    I finally resolved the problem by granting access to the Everyone group of the ALL INBOXES top-level security as follow:
    - grant View access for objects (this was the kicker)
    - add rights to Content / Web Intelligence Report / Add Objects to the Folder

  • Unable to stream Channel 4 live

    This service is completely unwatcheable. Long pauses and regular message saying 'insufficient bandwidth'
    According to speedtest.net my connection has 32ms ping and 50M+ download speed.
    Using Chrome Version 25.0.1364.97 with no addons or ad blockers.
    Also when I go to the MyBT site, pages take 60-90 seconds to load.
    Apart from BT and Channel 4, everything else seems fine.
    Anyone got any ideas ?
    Thanks

    Others have reported Channel 4 buffering issues, you're not alone. MyBT can be slow from time to time. 

  • Anybody know the internal implemention of streaming channel in BlazeDS

    Client(localhost:4963) -> Server(localhost:8400)
    Server half close the connection between localhost:4963 and localhost:8400.
    Client(localhost:4964) -> Server(localhost:8400)
    Server pushs the message to client via the channel between localhost:4963 and
    localhost:8400.
    The above flow is from the sample(Publish/Subscribe Messaging (Data Push Use Case).
    My question is how to store the channel(4963 <- 8400) after half-closing it? Which code to handle it in the code base?
    Thank you

    Not really sure what you mean by "half-closing" and the question you're asking. Can you clarify?

  • LG blu ray players to stream FIOS channels wireless

    I am looking to try using a wireless LG blu ray player to stream some channels from FIOS instead of having to purchase additional cable boxes for some bedroom TVs.  I can not find the technical requirements  I need in a device to get this to work.  Is FIOS DLNA compatible? Has anyone found a wireless blu ray player that has had experience with streaming channels from Verizon as is advertised on their website?

    BrownGriz wrote:
    I am looking to try using a wireless LG blu ray player to stream some channels from FIOS instead of having to purchase additional cable boxes for some bedroom TVs.  I can not find the technical requirements  I need in a device to get this to work.  Is FIOS DLNA compatible? Has anyone found a wireless blu ray player that has had experience with streaming channels from Verizon as is advertised on their website?
    The first link contains support information for LG streaming devices. At the bottom of the page it shows the two currently supported Blu Ray players. You would need to do your own evaluations in regards to the wireles. But right now I have for example, Redbox Instant Beta loaded in my Iphone and it streams Via 3G or Wifi.
    The Redbox Beta list of players is not final, as the service is being tested.
    Not the same as a BD player, but my X box is streaming those 75 channels with an ethernet cable, and I have not tried it with wireless.
    Samsung information is also available from Verizon.
    I hope this information is helpful. They may not show it but here are Verizon's listed devices that can download the app from the app stores.
    LG Support 
    https://www22.verizon.com/Support/Residential/TV/FiosTV/Other+Hardware/OtherDevices/LGDevices.htm
    Which LG Devices Are Supported?
    Smart TVs
    LM9600
    LM9500
    LM8600
    LM7600
    LM6700
    LM6200
    LS5700
    PM9700
    PM6900
    PM6700
    PM4700
    Blu-Ray Players
    BP620
    BP520
    Samsung support.
    http://www22.verizon.com/Support/Residential/TV/FiosTV/Other+Hardware/OtherDevices/SamsungDevices.ht...
    Which Samsung Devices Are Supported?
    Connected TVs
    Blu-ray Players
    2011 / 2012 Models
    D8000
    D7900
    D7050
    D7000
    D6500
    D6450
    D6400
    D6300
    D6050
    D6000
    PDP D6900
    D5550
    ES6100
    ES6150
    ES6500
    ES6550
    ES6580
    ES6600
    ES6820
    ES6900
    ES7100
    ES7150
    ES7500
    ES7550
    ES8000
    BD-D7500
    BD-D7000
    BD-D6700
    BD-D6500
    BD-D5500
    BD-D5300
    BD-E5500
    BD-E5900
    BD-E6500
    http://www22.verizon.com/home/fiostv/features#connect
    Some other information you may find interesting regarding my visit to the Consumer Electronics Show 2013 with Verizon.
    http://forums.verizon.com/t5/FiOS-TV-Programming/CES-2013-and-items-that-will-change-the-way-you-enj...

  • FYI: Extension Builder project w/ LCDS: channel-definition endpoint having context.root

    This is an FYI of an issue and its workaround.
    If developing a CS SDK Extension in Flash Builder / Extension Builder and the project is configured to use LCDS (LiveCycle DataServices), then if your services-config.xml contains Channel definitions having the variable {context.root} in the endpoint URL, then the following error will occur.  This will happen even if you are not using that Channel in your Destination channel list.
    The services-config.xml laid down when using LCDS integrated into ColdFusion has by default some channel definitions using context.root in the endpoint URLs.   This is how I encountered the issue.  On the other hand, the free developer edition of LCDS on Tomcat puts down a services-config.xml that does not have any reference to {context.root} in channel definitions, so the problem will not be encountered there.
    Since I was not using a context root (was using the default of just "/"), I commented out the offending channels in services-config.xml to resolve the issue.  One could also leave the (unused) channel definitions and then remove the {context.root} part from the endpoint.
    ERROR
    The services configuration includes a channel-definition 'java-amf' that has an endpoint with a context.root token but a context root has not been defined. Please specify a context-root compiler argument.
    CHANNEL DEFINITION
    <!--  Java Based Endpoints -->
            <channel-definition id="java-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
            </channel-definition>

    Make sure your context root is defined in the project properties.  This is at "project/properties/Flex Server" from the menubar or package explorer context menu.  Alternately, you can hardcode your context root in the services-config.xml file/channel definition.

  • RFC channel error

    Hi Experts,
    First time, transport objects form DEV to QTY server in SAP PI 7.31 dual stack.
    My scenario is RFC to JDBC. Activation is done, but when try to test RFC destination from ECC qty (which freshly created in ECC QTY) getting some error in sender channel.
    RFC destination error
    for Unicode test
    Any suggestion to resolve this issue?
    Thanks,
    Arthita

    Hi
    Two check if the program is registered go to SMGW.
    Go to --> Logged on clients.  Here must appear your PROG_ID
    If not, check authorizations to register external programs (RECINFO and SECINFO)
    Regards
    Javi

  • OGG based stream wont open with VLC program

    Hi, I have tried to open my country`s online radio stream via VLC but no success.
    1. I opened File, 2. streaming/exporting wizard 3. writing all needed information:input stream: mrfm.ogg
    partial extract:no, streaming method:UDP-unicast, destination. is my IP address, include substitution:no, transcode avoid:no, encap format:MPEG ts, TTL:1, sap announce: no
    MRL: sout=#standard (mux=ts,dst=my IP addu access=udp) sout-transcode-soverlay=no
    no suitable access, an error has occurred which probably prevented the proper execption of the program. main depug thread 43556352 joined (input/input c: 412)
    I am basic user couldnt fix Mplayer installion (too difficult) also dont know how to fix this problem with Quicktimeplayer. I can listen several other home and foreign radiostations without problems.

    januszmn wrote:
    The client times out.....and the server keeps running, no connection is made, though....the original....
    http://williams.comp.ncat.edu/Networks/JavaSocketExample.htm
    works without a hitch with either localhost or another machine running the server program....
    I guess nobody actually read to original description, or the arguments, or the stack trace I have provided when requested...No, nobody read the original description because there was a million lines of code. I read the other stuff and (as I already predicted) you have a network connectivity problem. Nothing to do with your code at all.
    As I already said, you now have to learn about your network. Can you ping the server you are connecting to? Can you telnet to the port where the server is running? (You should really understand basic networking before you write networking programs, not after.)

  • LCDS Streaming AMF Issue with Multiple Broswer Tabs

    Hi,
    I am facing the below problem with LiveCycle DS NIO Streaming AMF.
    I am using NIO Streaming AMF for pushing data to clients using Subtopics and selectors. The Consumer I have used is MultiTopicConsumer.
    The issue that when I try to open the application in two tabs of a browser, the consumers from the first tab connect fine, but the consumers from the 2nd tab throws the below error as taken from flashlog.txt.
    'my-nio-amf-stream' channel got status. (Object)#0
    code = "NetConnection.Call.Failed"
    description = "HTTP: Failed"
    details = "http://localhost:2080/nioamfstream"
    level = "error"
    '2885C524-D185-7679-9AC1-EC057C9E0085' consumer channel faulted with Channel.Call.Failed NetConnection.Call.Failed: HTTP: Failed
    '2885C524-D185-7679-9AC1-EC057C9E0085' consumer fault for '28AC4573-EB7C-CBCE-9EE5-EC057F0F0EF8'.
    From the LCDS Debug logs what i can find is that the FlexSession being used is same and that might be causing the problem.
    Please help me as to how to make the subscriptions work from multiple tabs of the same browser.
    Can someone please help me in this regards?
    Thanks in advance.

    Hi,
    I am facing the below problem with LiveCycle DS NIO Streaming AMF.
    I am using NIO Streaming AMF for pushing data to clients using Subtopics and selectors. The Consumer I have used is MultiTopicConsumer.
    The issue that when I try to open the application in two tabs of a browser, the consumers from the first tab connect fine, but the consumers from the 2nd tab throws the below error as taken from flashlog.txt.
    'my-nio-amf-stream' channel got status. (Object)#0
    code = "NetConnection.Call.Failed"
    description = "HTTP: Failed"
    details = "http://localhost:2080/nioamfstream"
    level = "error"
    '2885C524-D185-7679-9AC1-EC057C9E0085' consumer channel faulted with Channel.Call.Failed NetConnection.Call.Failed: HTTP: Failed
    '2885C524-D185-7679-9AC1-EC057C9E0085' consumer fault for '28AC4573-EB7C-CBCE-9EE5-EC057F0F0EF8'.
    From the LCDS Debug logs what i can find is that the FlexSession being used is same and that might be causing the problem.
    Please help me as to how to make the subscriptions work from multiple tabs of the same browser.
    Can someone please help me in this regards?
    Thanks in advance.

Maybe you are looking for