Skip to main content

All Questions

Tagged with
0 votes
0 answers
18 views

Multiple streamed response combined in a single iterator in Scala

I have multiple replicas of a service from which I am receiving a stream of response: // RPC call to server that returns a stream of response. def getResult(input: Request): Iterator[ResultItem] On ...
Kyuubi's user avatar
  • 1,228
0 votes
0 answers
86 views

execution a scala file with spark to read a kafka topic

I'm trying to run a scala code to read a kafka topic but I'm still having this error msg. I would like also to know if there is any other method to run a scala code from file (I'm using spark-shell -i ...
Hsgh775's user avatar
  • 11
0 votes
0 answers
368 views

FS2 stream inside a stream

I have an FS2 stream that reads a queue and for each received message, it then reads a file as a stream. How do I model such a stream inside a stream in FS2 ? I can achieve this using a flatMap ...
Jeet Banerjee's user avatar
1 vote
1 answer
134 views

Using Stax2 to escape special characters in Scala

I am trying to use Stax2 in order to write xml files with escaping special characters for the attributes. When I am trying to achieve is an exact output like this: <elem1 att1="This &#x0A; ...
Usr654789's user avatar
0 votes
2 answers
108 views

Adding values from a Map to an existing Source in Scala

I am using akka streams. Can we add values from a map to an existing source in scala? I want to merge all the values from a Future[Map[String, A]] and a source of A Source[A,_] which are not already ...
Siddharth Shankar's user avatar
0 votes
1 answer
86 views

Define a function that filters items from the lazy list of lazy list

Define a function that filters items from the lazy list of lazy list. The function is supposed to have two parameters: lazy list of lazy lists and number. Only lazy lists whose length is greater than ...
N M's user avatar
  • 9
0 votes
1 answer
125 views

Split stream into two streams

Define the "split" function that divides a stream into two streams. The first list should contain elements with odd indexes and the second with even indexes. Example: split(Stream(5, 6, 3, 2,...
N M's user avatar
  • 9
0 votes
1 answer
198 views

Scala Akka Flow output dealing with an Either

I am facing a problem using akka http and web socket. I have a function through my code that is returning me the following type: Flow[String, Either[RuntimeException, T], Any] And from that type I ...
gwenael's user avatar
  • 15
0 votes
1 answer
110 views

Conditional concatenation of iterator elements - A Scala idiomatic solution

I have an Iterator of Strings and would like to concatenate each element preceding one that matches a predicate, e.g. for an Iterator of Iterator("a", "b", "c break", &...
Fil Karnicki's user avatar
0 votes
2 answers
124 views

Scala Stream Contiually get rid of var

I'm trying to generate an infinite list of dates by substracting one month from the current date, i want to do this using Streams. Here's what i've done so far : import org.joda.time.LocalDate var ...
Fragan's user avatar
  • 852
1 vote
0 answers
91 views

Scala Play Framework: How to send console output of command to http response and display line by line in textarea

I want to display a console output using textarea in browser, upon button click, I run process on server and send the output to the textarea. So far I managed to do the following: on server: def ...
boreas's user avatar
  • 1,061
1 vote
0 answers
47 views

Loss records on spark kafka stream

i loss records in my kafka streams. My kafka stream is in spark infra with that config. val df = spark. readStream. format("kafka"). option("kafka.bootstrap.servers&...
Sebastien Warichet's user avatar
0 votes
1 answer
139 views

Akka HTTP. Streaming source from callback

I am trying to connect Akka HTTP and some old Java library. That library has two methods - one accepting a callback function to receive string, and one signaling the end of data stream. The callback ...
RB_'s user avatar
  • 1,182
1 vote
0 answers
173 views

What is the correct way to fetch elements from Akka Source Stream?

Overview I have two microservices called warehouse-microservice (server) & grocery-microservice (client). And I'm trying to implement a streaming request & streaming response between them ...
Amey Lokhande's user avatar
0 votes
1 answer
118 views

How to calculate closest total price from item prices collection with multiple items

Given a set of prices from a provider I want to work out the closest matching item set that will match a total value. IE. The total value to match is $5, I have a price list from MongoDB as follows ...
Titan Chase's user avatar

15 30 50 per page
1
2 3 4 5
21