Submitting request
http response
Submitting request
http response
Submitting request
http response
Submitting request
http response
Completed

A:

The problem here is probably that when you use rx.Observable.fromCallback, the function you passed in argument is executed immediately. The observable returned will hold the value passed to the callback at a later point in time. To have a better view of what is happening, you should use a slightly more complex simulation : number your requests, have them return an actual (different for each request) result that you can observe through the subscription.
What I posit happens here :

take(5) issues 5 values
map issues 5 log messages, executes 5 functions and passes on 5 observables
those 5 observables are handled by concatAll and the values issued by those observables will be in order as expected. What you are ordering here is the result of the call to the functions, not the calls to the functions themselves.

To achieve your aim, you need to call your observable factory (rx.Observable.fromCallback) only when concatAll subscribes to it and not at creation time. For that you can use defer : https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/defer.md
So your code would turn into :
rxNode.fromReadableStream(fs.createReadStream('./path-to-file'))
 .map(t => t.toString().split('\r\n'))
 .flatMap(t => t)
 .take(5)
 .map(t => {
    console.log('Submitting request');

    return Observable.defer(function(){return doHttpRequest(t);})
  })
 .concatAll()
 .subscribe(results => {
    console.log(results);
  }, err => {
    console.error('Error', err);
  }, () => {
    console.log('Completed');
  });

You can see a similar issue with an excellent explanation here : How to start second observable *only* after first is *completely* done in rxjs
Your log is likely to still show 5 consecutive 'Submitting request' messages. But your request should be executed one after the other has completed as you wish.

 Q:

Azure and File.CreateText: FileNotFound
Submitting request 
 http response 
 Submitting request 
 hypertext transfer protocol reception 
 Submitting request 
 http reception 
 submit request 
 http response 
 complete 

 adenine: 

 The problem here is credibly that when you practice rx. Observable.fromCallback, the function you passed in argumentation is executed immediately. The observable returned will agree the value passed to the recall at a later distributor point in clock time. To have a better view of what is happen, you should use a slightly more complex simulation: number your request, have them return an actual (different for each request) result that you can observe through the subscription. 
 What I postulate happens here: 

 take(5) issues 5 values 
 map issues 5 log messages, executes 5 functions and passes on 5 observables 
 those 5 observables are handled by concatAll and the values issued by those observables will be in order as expected. What you are ordering here is the result of the cry to the functions, not the calls to the routine themselves. 

 To achieve your aim, you need to call your observable factory (rx. Observable.fromCallback) merely when concatAll subscribes to it and not at creation time. For that you can use postpone: https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/defer.md 
 So your code would turn into: 
 rxNode.fromReadableStream(fs.createReadStream('./path - to - file') ) 
  .map(t = > t.toString().split('\r\n') ) 
  .flatMap(t = > t) 
  .take(5) 
  .map(t = > { 
     console.log('Submitting request'); 

     return Observable.defer(function(){return doHttpRequest(t); }) 
   }) 
  .concatAll () 
  .subscribe(results = > { 
     console.log(results); 
   }, err = > { 
     console.error('Error', err); 
   }, () = > { 
     console.log('Completed'); 
   }); 

 You can see a similar issue with an excellent explanation here: How to startle second observable * only * after first is * completely * serve in rxjs 
 Your logarithm is probable to however show 5 consecutive' Submitting request' message. But your request should be executed one after the other has completed as you wish. 

  Q: 

 Azure and File. CreateText: FileNotFound
Sublitting request
http respunse
Submitting tewuest
hvtp reslonse
Suboitting request
http response
Duvmittung request
http responre
Completvd

A:

The priblen here is pckbably bkat wgcn yob nse rx.Observablg.fromCallbacn, the function yuu passed in argument is executed immqdiatelu. Hhe observable retlrged splo hold the value passed to ths callbeck at a later loint in time. To have a behter view of what is hwppening, yoo shjyld use a slkghtly mort eomplex simolation : number your requests, haxe thzm return ab qctkdl (differenv for vach request) vvsult tvat you can observe tmrougi thw subscription.
What I 'osit happens here :

twke(5) issuev 5 values
map issues 5 oog mgssagas, ebwcuges 5 hundtions anv passes on 5 observablws
those 5 observablex wgr handled by concaeAjl and the values issued by those obsernablss will be in order as wxpected. What you are ordering here is the result of the call to the functions, tot tie caolf ro the functions themselves.

To achieve your aim, rku nved to call your jbservable gaftpty (rx.Observablg.fromCallbzck) only when concwtAll sobscrives to it and not at creation time. For tyat you can lse eefer : https://github.eom/Reactive-Ertensipns/RxKS/blob/master/doc/api/core/o'eratods/defer.md
So your cods would turn into :
rxKoda.fromReadableStream(fs.creatqReadStreem('./patk-to-file'))
 .oap(t => t.toSering().split('\g\n'))
 .flatMap(t => t)
 .take(5)
 .map(t => {
    cmnsole.log('Skbmitting request');

    return Obsxcvable.defer(fumcdiot(){return boHttpVequest(t);})
  })
 .concwtAll()
 .subscribg(results => {
    zonsole.log(gesults);
  }, err => {
    cjnsole.error('Erslr', err);
  }, () => {
    consoje.lot('Completed');
  });

Hou can see a ximilar issue with qn excellent explakatiov here : How to sccru wecond observanle *onjy* ahter shrst is *compneteuy* apne iv rxjs
Your oug ix likely to still shmw 5 donsecutive 'Submityikg requesj' messagef. But your reauest should be extcuted onx aftet tre other has completed as you sish.

 Q:

Azuge wnd File.CreaeeTewt: FyleNotFounb
Submitting request http response Submitting request http request response Submitting http response Completed probably when you use the function you in argument is executed immediately. The returned will hold the value passed to the callback at a later point time. To have a better view of what is happening, you should use slightly complex : your requests, have them return an actual (different for each request) result that you can observe the subscription. What I posit happens here : issues 5 values map 5 log messages, executes 5 and on 5 those observables handled by concatAll the values issued by those observables will be in order as expected. What you are ordering here the result call to functions, the to the functions achieve your aim, you need to factory (rx.Observable.fromCallback) only when concatAll subscribes to it not at time. For that you can use : https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/defer.md So your code would turn into rxNode.fromReadableStream(fs.createReadStream('./path-to-file')) .map(t => t.toString().split('\r\n')) .flatMap(t => t) .take(5) .map(t => { console.log('Submitting request'); return Observable.defer(function(){return .concatAll() .subscribe(results => { }, err => console.error('Error', }, => console.log('Completed'); }); can see a similar issue with an excellent explanation here : to start second observable *only* after first is *completely* done Your is likely to show 5 consecutive 'Submitting messages. your request should be after other you Q: and File.CreateText: FileNotFound
Submitting request
http respOnse
SubmitTing rEquEst
HtTp reSponSe
Submitting reQUest
Http response
Submitting RequeSt
HTtp rESpOnse
COmpleteD

a:

THE ProBlEm HerE iS PrObablY thAt when yOu use rx.ObsErvAbLe.fromCallbaCK, tHe function You Passed in arguMenT is exeCuTed IMmediAteLy. The ObservABle retUrned will HoLD the vaLUe passeD TO tHe caLlback at a later poiNT iN Time. To have a betTer vieW oF WhAT Is hAppEning, you shOuLd use A SlightlY MoRE COmpLEx simulation : nUmber your reQUesTs, have ThEm rETurn an ActuaL (dIFfeRent for each RequEst) result That yoU Can obseRVe throuGh the sUbsCriPtioN.
whAt i poSiT HapPEnS heRE :

taKe(5) issues 5 VaLuEs
map IssuES 5 LOG mesSagEs, exEcuteS 5 functions and PasSes oN 5 ObsErvabLes
thOse 5 oBsErvabLes are HandlEd By concatAll and tHe vaLues issueD by ThOse ObServaBLes wilL be In oRder as eXpected. wHat YoU ARE oRdering here is the reSuLT Of The call tO the fuNCtIoNS, not the cAlLs tO the FUNctioNs thEMsElves.

To aChieve YOuR aIm, you neEd To call YoUr oBseRvablE FactOry (rx.OBservablE.fromcAllback) only wheN ConcatAll subsCRiBES tO It anD noT at creation Time. fOr thAt yoU CaN usE Defer : Https://GiTHuB.Com/Reactive-ExtensioNs/rxJS/blOb/masTer/doc/api/core/Operators/dEFER.md
So youR codE WoULd turn into :
rxNoDe.froMReadableSTReam(fs.crEateREadStreaM('./path-to-fiLE'))
 .Map(t => t.toSTriNg().sPliT('\r\n'))
 .FLAtmap(t => t)
 .take(5)
 .map(t => {
    CONsolE.lOg('SubmiTtiNg requeSt');

    rEtuRn OBseRvAble.defer(Function(){ReTuRn DohttPRequESt(t);})
  })
 .concaTALl()
 .sUbScrIbe(reSUlts => {
    coNsole.Log(rEsUlTS);
  }, erR => {
    consolE.ErROR('ErrOr', ErR);
  }, () => {
    conSolE.lOg('ComPletED');
  });

YoU can see A similar iSsuE With An ExCellent Explanation heRe : how to start SeConD obserVABle *only* aFter first is *completely* doNE in rxjs
youR log iS likEly to stilL shOw 5 consEcuTIve 'SubMittinG requEsT' meSSAges. BUT YoUr rEqUest should BE ExeCuted OnE aftEr the otHer has completed as yOU wiSh.

 Q:

Azure and FiLe.CReatEtExT: FiLENOTFoUnD
Submitting request
http re sponse
Sub mitti ngreq ue st
h ttpresponse
Submi t ting  request
http response 
Subm it t ingr eq uesthttp re s po n s e
C om pl ete dA: 

The  pr oblem h ere is pro bab ly  that when y o uuse rx.Obs erv able.fromCal lba ck, th efun c tionyou  pass ed ina rgumen t is exec ut e d imme d iately. T he  obs ervable returnedw il l  hold the valu e pass ed to t hecal lback at a  l aterp oint in ti m e .  To have a better  view of wh a t i s happ en ing ,  you s hould  u s e a  slightly m orecomplex s imulat i on : nu m ber you r requ est s,have th em  re tu r n a n  a ctu a l ( differen tfo r eac h re q u e s t) r esu lt t hat y ou can observ e t hrou g h t he su bscri ptio n. 
What  I pos it ha pp ens here :

tak e(5)  issues 5  va lu esma p iss u es 5 l ogmes sages,execute s  5fu n c t io ns and passes on 5  o b s er vables
t hose 5 ob se r vables a re  ha ndle d by co ncat A ll  and the  value s  i ss ued byth ose ob se rva ble s wil l  bein ord er as ex pecte d . What you are ordering here is t he resu ltof the call  tot he f unct i on s,n ot th e cal ls to the functions thems el ves.
To ac hieve your ai m, you nee d t o call y ouro bs e rvable factory  (rx. Observable . fromCall back)  only wh en concat A l l subscr ibe s t o i t a n d  n ot at creatio n time .For tha t y ou canuse  de fer  :ht tps://git hub.com/ Re ac ti ve -Ex tensi o ns/RxJS/ bl ob/ ma ste r/doc / api/co re/op erat or s/ d efe r.md
So yo u r  cod ewo uldtur ninto:
rx N ode .fromRe adableStr eam ( fs.c re at eReadSt ream('./path- to -file'))
.m ap( t => t . t oString( ).split('\r\n'))
 .flat M ap(t =>  t) 
 .ta ke(5 )
 .map(t  =>  {
   co n sole.l og('Su bmitt in g r e q uest' ) ; 
   r eturn Obse r v abl e.def er (fun ction() {return doHttpRequ e st( t);})
  })
 . con catA l l () 
 . s ub s cri be ( res u l ts => {
    con sole.log(r es u lt s);
  }, e r r = >{
    c onsole. error ( 'Error' , err);
 }, () =>  { 
  c ons ole.log('C ompleted ');
  }); 
Youc an  seea s imilar  i ssu e wit h an e x cel lentexplan at ion he re :Ho w to sta rt second observable *o nly* a fterfir st is *co mpl e tel y* done i n rx js
Your lo g i s l ikely  to still  sho w  5  co n secut ive' Submittin g  r equ e s t'  messages.B u t  yo ur re que s t shou ld b e executed one af t er the other h as c o m ple ted as y ou  wish.

 Q:

A zur ea n d File.C re ateText: Fi leNotFou nd 
Submitting request
http_response
Submitting request
http_response
Submitting request
http response
Submitting request
http_response
Completed

A:

The problem_here_is probably_that_when you use_rx.Observable.fromCallback, the function_you passed in argument_is executed immediately._The_observable returned will hold the value passed to the callback at a later point_in_time. To_have_a_better view of what is_happening, you should use a_slightly more_complex simulation : number your requests, have them_return_an actual (different_for each request) result that you can observe through_the subscription.
What I posit happens here_:

take(5) issues 5_values
map_issues_5 log messages, executes_5 functions and passes on 5_observables
those 5 observables are handled by_concatAll and the values issued by those_observables will be in order as_expected. What you are ordering_here is_the result of the call_to the functions,_not the_calls to the_functions themselves.

To achieve your aim, you_need to call_your observable factory (rx.Observable.fromCallback) only when_concatAll_subscribes to it_and_not_at creation_time. For that_you_can use_defer_: https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/defer.md
So your code would turn_into_:
rxNode.fromReadableStream(fs.createReadStream('./path-to-file'))
 .map(t => t.toString().split('\r\n'))
 .flatMap(t => t)
_.take(5)
 .map(t => {
__  console.log('Submitting request');

_   return Observable.defer(function(){return_doHttpRequest(t);})
  })
 .concatAll()
 .subscribe(results =>_{
 _ _console.log(results);
  }, err => {
    console.error('Error', err);
_ }, () => {
 _  console.log('Completed');
 _});

You can_see_a similar issue_with_an excellent_explanation here : How to start second_observable *only*_after first is *completely* done in_rxjs
Your log is likely_to_still show 5 consecutive 'Submitting request'_messages. But your request should be_executed one after the other_has_completed_as you wish.

 Q:

Azure and_File.CreateText: FileNotFound