How to test the performance of thrift service by loadRunner? - performance

I build a service used thrift, and host it on a tomcat server by TServlet , the protocol is TCompactProtocol
I want to test the service by loadrunner, but i don't know how to record the test script

What protocol you would select for your thrift interface testing is entirely dependent upon the transport used in your implementation
http://thrift.apache.org/docs/concepts/
If raw TCP, then Winsock. If HTTP, then Web Virtual User (with Web_custom_requests() and recording headers), etc....
Note, not all interfaces are recordable. Some you will have to build code directly. With Thirft you ~~may~~ be able to build a client using the Java template virtual user type.
If this is your first venture into sockets of Java virtual user types then you will want to have a mentor with you for the ride. Otherwise its going to be extremely painful and far less fruitful than it should be.

Related

are there any implementations of coap-http or mqtt-http cross proxies available which can process thing descriptions?

I am using the node-wot browser library and I would like to connect IoT-devices communicating via MQTT and CoAP to the browser. As the browser/ library is not capable of communicating via MQTT or CoAP, are there any implementations of HTTP-CoAP or HTTP-MQTT proxies available which can process thing descriptions?
The idea would be to have a proxy where I could connect my device to, simply by providing a w3c wot thing description. Ideally the proxy would create another thing description which I could use to connect the browser to the proxy via HTTP.
You can check out the shadow-thing project for an existing implementation but it is rather easy to this yourself with node-wot:
Fetch the TD of the Thing you want to proxy and consume it to create a consumed thing.
Take that TD and put it into the produce() method.
Add handlers for all the affordances
In each handler make the appropriate call to the consumed Thing.
Resolve the messages you get via your exposed Thing so that they are returned to your consumer.
For me the requirements are not that clear.
The open source project Eclispe/Californium comes with coap2http cross proxy functionality (and also http2coap). You may try it demo-apps/cf-proxy2

RPC authenthification explained with windows api

I would like to make a IPC between two processes using Windows RPC. Please explain me like I am five how my application should achieve good security. I want to use ncalrpc protocol (processes on the same computer). More exactly:
How my client application knows that the server is trusty?
How my server know if the callee is the trusted one?
What options do I have? I didn't get RpcBindingSetAuthInfo function.
Thanks
For a local connection having the client authenticate the server is fairly hard (for example confirming that some other service did not start in place of the desired program) but having the server identify the client is not, call RpcBindingInqAuthClient and use the username to determine what action to take, or just use RpcImpersonateClient if you can rely on existing secured objects. Most of the RPC security apparatus is for remote connections rather than ncalrpc.

Integration of Shenzhen Concox Information Technology Tracker GT06 with EC2

I have a concox GT06 device from which I want to send tracking data to my AWS Server.
The coding protocol manual that comes with it only explains the data structure and protocol.
How does my server receive the GPS data collected by my tracker?
Verify if your server allows you to open sockets, which most low cost solutions do NOT allow for security reasons (i recommend using an Amazon EC2 virtual machine as your platform).
Choose a port on which your application will listen to incoming data, verify if it is open (if not open it) and code your application (i use C++) to listen to that port.
Compile and run your application on the server (and make sure that it stays alive).
Configure your tracker (usually by sending an sms to it) to send data to your server's IP and to the port which your application is listening to.
If you are, as i suspect you are, just beginning, consider that you will invest 2 to 3 weeks to develop this solution from scratch. You might also consider looking for a predeveloped tracking platform, which may or may not be acceptable in terms of data security.
You can find examples and tutorials online. I am usually very open with my coding and would gladly send a copy of the socket server, but, in this case, for security reasons, i cannot do so.
Instead of direct parsing of TCP or UDP packets you may use simplified solution putting in-between middleware backends specialized in data parsing e.g. flespi.
In such approach you may use HTTP REST API to fetch each new portion of data from trackers sent to you dedicated IP:port (called channel) or even send standardized commands with HTTP REST to connected devices.
At the same time it is possible to open MQTT connection using standard libraries and receive converted into JSON messages from devices as MQTT in real time, which is even better then REST due to almost zero latency.
If you are using python you may take a look at open-source flespi_receiver library. In this approach with 10 lines of code you may have on your EC2 whole parsed into JSON messages from Concox GT06.

p2p direct data exchange...via HTTPS?

Is there any protocol, API or software in existence that can send data/IM/etc directly from one device to another with no server?
Can you not use HTTP GET/POST/DELETE directly between two devices when their device data is known to the user(s)?
I would very much like to know if there is ANY software/protocols that can do this.
thank you!
The internet is build on the Internet Protocol suite. This suite has 5 different layers of protocols: The physical layer, the link layer, the network layer, the transport layer and the application layer. Each depends on the one before.
If you just use the browser, by default HTTP (application layer) is used, which relies on TCP (transport layer), which relies on IP (v4 or v6, network layer), which relies on ethernet (link layer), which finally relies on the actual cable that's plugged into your computer (for WiFi, the first three are the same but the last two differ if I'm not mistaken).
Now to your question: Is there any protocol, API or software in existence that can send data/IM/etc directly from one device to another with no server?
Yes there is. I suggest you start looking at protocols that are in the application layer. To highlight a few standards next to HTTP(S): FTP is for file transfer, IMAP is for emails clients, SMTP is for email servers and SSH is a secure shell which can also be used to tunnel data through.
For your specific case, I think either FTP (FTPS if you want it over SSL), or SSH can be a solution, but it's hard to know for sure without the specifics.
The only thing that these protocols have in common is that one of the two computers will act like server and the other computer as client. This has as downside that port-forwarding might be necessary.
If you've chosen the protocol you'd like to use, then you're up for the next step, selecting a program that can do that for you. For HTTP(S), I'd recommend Apache. If you're using Linux and chose SSH, then you're in luck, there is a build in SSH server in Linux, you can use that. For other protocols, you might just want to search yourself, as I do not have any suggestions.
I hope this answers most of your questions!
Desirius
In browser context, WebRTC is probably what you are looking for: It allows user to user communications.
https://en.wikipedia.org/wiki/WebRTC
https://webrtc.org/

How does a JDBC driver implementation work?

A JDBC driver implementation provides the low level details that allows a client to communicate with a third party datababase. I am just curious what it is doing behind the scenes. Communication between two systems written in different languages usually happens through web services.
Does the jdbc driver use web services to communicate between the client and the db server? Or am i oversimplifying?
People who write JDBC drivers have several options to choose from:
Type 1 driver: Use the generic JDBC-ODBC bridge, don't actually make a driver.
Type 2: Make a "wrapper" that uses JNI to call functions in a native client library.
Type 3: A generic driver that connects to a "middleware" service that talks with the database.
Type 4: a pure-Java implementation of the database communication protocol.
A type 3 driver might use web services to talk with the middleware. The other types of driver most likely communicate in a database-specific binary protocol over TCP/IP sockets (if the database is on a remote host) or other suitable reliable transport, not through web services.
You should check this link as this shows you how JDBC works.
Now coming to your question : No JDBC do not use web services. The way it connects to different types of databases is due to the database vendors because different database vendors provide their own driver implementation and you just need to use that implementation. There's nothing like web services. Each database vendor provides you with some api of their own to access database which they map to the Java's api to access database which is generic.
Java is provides a generic api for database operations which ultimately does operations and communication with database using sockets.
So what you need to read is TCP/IP , Socket programming, IO and JDBC. Please don't forget to check the link it will surely help you understand the concept.

Resources