How to post the data in a .csv file using a TCP sampler in JMeter (Load Testing)? - tcp

I am getting stuck after creating a ".csv data config element" by inserting a file and a TCP Sampler with the proper Server ID and Port Number.
I have also created a thread group for it.

Given your CSV files looks like:
foo
bar
baz
and you want to send the next line on each iteration of each user you can do the following setup:
Add CSV Data Set Config as a child of your TCP Sampler and configure it like:
In the TCP Sampler use the JMeter Variable you specified in the "Variable Names" where needed:
That's it, when you run your test the JMeter Variable placeholder will be substituted with the respective value from the CSV file:

Related

Can asterisk monitor() and mixmonitor() applications be executed on same channel?

Im recording calls with Mixmonitor() application, it works fine, but recently i had a request to record each leg of call with addition to mixedfile. I know, that i can record each leg of call with Monitor() and then use external script tp mix it, but the problem is that it is additional loading of server. So I wonder can I do it by means of asterisk? For example by using Monitor and Mixmonitor together?
You can specify the call-legs with MixMonitor's parameters:
MixMonitor(mixed.wav,r(in.wav)t(out.wav))
as stated in the description:
asterisk*CLI> core show application MixMonitor
r(file): Use the specified file to record the *receive* audio feed.
Like with the basic filename argument, if an absolute path isn't given,
it will create the file in the configured monitoring directory.
t(file): Use the specified file to record the *transmit* audio feed.
Like with the basic filename argument, if an absolute path isn't given,
it will create the file in the configured monitoring directory.

My script creates multiple files for mails with multiple recipients

What I did is really simple to write incoming mail to file:
mailbox_command = path/to/mycript.py
luser_relay = unknown add, unknown = "|/path/to/myscript.py" to aliases file.
myscript.py reads from stdin line by line and writes the lines to file.
These lines redirects any incoming mail, no matter whether user exists
or not, to my script. My script reads data from stdin and writes it to file. If my script receives mail with one recipient it creates one file. But if it receives with 2 recipients, it creates 2 files. What I want is that it still should create 1 file. I want to make number of files created by script not related to number of recipients but related to number of messages received.
Thanks,
You can store in a file the email count, or just save each file, using epoch as filename
I would do it like this in ruby.
# read from stdin, and save a timestamp filename
IO.write Time.now.to_i.to_s,STDIN.read

Text file output from Biztalk?

I have a mapping in Biztalk from an external XML schema to an internal XML schema. The internal schema I wish to map to a flat file schema. But that doesent seems to be possible. I cant select the flat file schema as destination schema. So I guess I need to use a flat file assembler in a send pipeline? But on properties on the flat file assembler the flat file schema is not visible under Document Schema.
Do you know how to do this?
I use Biztalk 2009
+1 to what Jay said.
Moreover, You should do the following after step 2:
2.1 Create a new Map that references source schema (external schema) and destination schema (flat file schema created in step 2)
and then you should use this map to transform XML to flat file. This should be done using a send port configured with two things:
pipeline (already mentioned in Jay's response, #3)
Outbound Maps, you can find that in BizTalk Administration console under Send Port properties .. You should configure add the map you created in step 2.1 to the outbound maps.
Typically, you should be receiving the XML file on a receive location. so what you need to do is to create a new receive port, and a receive location. and in the send port properties (again!) add a new filter with the following configuration:
BTS.ReceivePortName == XXXXX
Where XXXXX is the receive port name.
This way, any message is received on receipt port XXXXX is going to be sent to the send port with the map and pipeline already configured.
Create an example flat file that has the formatting you want for your output
Create a flat file schema using the flat file schema wizard. Use your example file as the input to the wizard.
create a pipeline. Put the flat file assembler into the pipeline.
Click on the flat file assembler shape and set the document schema to the flat file schema you created. This tells it the format of the output file.
Create a send port and use the pipeline you created.
Send your data to the send port.

Biztalk File send port with a variable path

Is it possible to make the send port change output location based on a promoted property?
We have an interface that needs to send it to a different port based on the client. But we add clients on a regular basis, so adding a new send port (both in the administrator and orchestration) will require a lot of maintenance, while the only thing that happens is a directory change
The folders are like this ...
\\server\SO\client1\Out
\\server\SO\client2\Out
\\server\SO\client3\Out
I tried using the SourceFilename to create a file name like client1\Out\filename.xml but this doesn't work.
Is there any way to do this with a single send port?
It is possible to set the OutboundTransportLocation property in context. This property contains the full path/name of the file that will be output by the file adapter. So in your case I guess you could do something along the line (if it had to be done in a pipeline component):
message.Context.Write(
OutboundTransportLocation.Name,
OutboundTransportLocation.Namespace,
string.format(#"\\server\SO\{0}\Out", client));
Of course you can do a similar thing in your orchestration.
No need of a dynamic port...

Determining the actual file name sent when using Send Port Macros

I have a BizTalk 2009 send port that uses the %datetime_bts2000% macro in the file name. When I look at the tracked message event, I don't get the name of the actual file that was sent. I thought I could get it from the context property:
OutboundTransportLocation
SFTP://xxx#xxxx.xxx.com:22/Inbound/Encrypted/xxx.xxx.xxx.201101280410324
Promoted
http://schemas.microsoft.com/BizTalk/2003/system-properties
It turns out that the date is equivalent to my deployment date... not the actual date time stamp of the sent file.
Where do I find the actual filename generated by the Macro?
I happen to agree with #Bryan. I have in fact created such a pipeline to preserve OR set the attachment file name explicitly in a pipeline that I use for email.

Resources