I am running an Azure Function on Java with EventHub trigger. Now the function receives 1000s of messages per min. It is becoming difficult to track your changes after deployment as the logs are showing one day old content. Now even though I have commented out certain lines and added other lines to verify my changes, after deployment it still shows the commented lines. When I observed it, those were old logs. Is there any way to change that? As I have to wait a long time to see my changes on kudu console.
Where do I change the settings, so that my changes will reflect on basis of current changes?
Update:
I am using below setup in host.json. So may be because of the property "initialOffsetOptions/type" my function is processing already processed events after each deployment. I have got this link Slow down EventHubTrigger in Azure Function but I am yet to test it. Any suggestion on this is welcome.
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.*, 4.0.0)"
},
"extensions": {
"eventHubs": {
"batchCheckpointFrequency": 5,
"eventProcessorOptions": {
"maxBatchSize": 256,
"prefetchCount": 512
},
"initialOffsetOptions": {
"type": "fromStart",
"enqueuedTimeUtc": ""
}
}
}
}
Now even though I have commented out certain lines and added other lines to verify my changes, after deployment it still shows the commented lines.
Make sure you check your deployment is done. And check for the Deployment history and last modified details of deployments in an Activity Log. (Resource Group -> Deployments -> Activity Log)
Is there any way to change that? As I have to wait a long time to see my changes on kudu console. Where do I change the settings, so that my changes will reflect on basis of current changes?
If you are using Consumption Plan, make sure you have to wait till your Function app restarts after deployment. After Deployment the Consumption Plan will take some time to sync the function trigger operation.
To avoid the problems, you can use the Premium App Service plan or enable Always On feature in your app service plan.
Related
I am sending a POST request to the Google analytics measurment protocol
at
https://www.google-analytics.com/collect?v=1&t=event&tid=UA-151666808-2&cid=123&el=cus&ea=CLIENT_REGISTRATION_SUCCESS3&ec=Server
However it is not being tracked on my site. I am sending it with Java API. I use rest template, feingClient, gama-client-core, google-analytics-java libraries. The result is always the same - the event does not track. If I change mine tid to another, then the event is displayed in another resource. Or if I call this link through POSTMAN, then the result is also successful.
The debug call for your request looks fine.
{
"hitParsingResult": [ {
"valid": true,
"parserMessage": [ ],
"hit": "/debug/collect?v=1\u0026t=event\u0026tid=UA-151666808-2\u0026cid=123\u0026el=cus\u0026ea=CLIENT_REGISTRATION_SUCCESS3\u0026ec=Server"
} ],
"parserMessage": [ {
"messageType": "INFO",
"description": "Found 1 hit in the request."
} ]
}
Data Processing time.
Check the real time api to ensure that the hits are being recorded if they are then you are all set. Then wait 24 - 48 hours for the data to complete processing you should see it in the standard reports then.
bot filtering
Make sure you have disabled bot filtering on the view
New google analytics account
It takes up to 72 hours for an account newly created in Google analytics to start showing data.
Quoted from google measurement protocol reference
Note that Google has libraries to identify real user agents. Hand crafting your own agent could break at any time.
You should change the request User-Agent to a browser like one so google doesn't think you are a bot.
So I am making an app that has to check for some information, but I need to be able to do that while the app is killed/not actively running. So basically like Youtube's notifications or something. I am a beginner and watched some tutorials on FCM, which can send a notification while the app is killed, which is fine. However, I need to be able to periodically make API calls, check if a certain condition is true and send the notification if so (all of that while app is not running). I tried googling that and found nothing that can help me. So... any ideas? (No code included since I don't think it's relevant.)
If this condition only affects the display of notifications, you can simply check the condition when you receive a notification through FCM. Here's an example :
class FCMService : FirebaseMessagingService()
{
override fun onMessageReceived(message: RemoteMessage)
{
val myCondition = getConditionFromAPI()
if (myCondition) {
showNotification(message)
}
}
}
Use AlarmManager to request periodic runs of your code. It may be set up to broadcast a message time to time to your receiver (declared in AndroidManifest.xml or in your code).
It will work while device is on. To continue after reboot, you have to set up a receiver for Intent.ACTION_BOOT_COMPLETED and register it in your code (not in AndroidManifest.xml, as it no longer works in latest versions of Android).
I downloaded XS_JSCRIPT14_10-70001363 package from Service Marketplace.
Please suggest me how to run this App Router Login form with localhost
I am trying with npm startcommand, but getting UAA service exception. How to handle from localhost.
When you download the approuter, either via npm or service marketplace you have to provide two additional files for a basic setup inside the AppRouter directory (besides package.json, xs-app.json, etc.).
The default-services.json holds the variables that tell the approuter where to find the correct authentication server (e.g., XSUAA). You have to provide at least the clientid, clientsecret, and URL of the authorization server as part of this file like this:
{
"uaa": {
"url" : "http://my.uaa.server/",
"clientid" : "client-id",
"clientsecret" : "client-secret",
"xsappname" : "my-business-application"
}
}
You can get this parameters, for example, after binding on SAP Cloud Platform, CloudFoundry your application to an (empty) instance of XSUAA where you can retrieve the values via cf env <appname> from the `VCAP_SERVICES/xsuaa' properties (they have exactly the same property names).
In addition, you require the default-env.json file which holds at least the destination variable to which backend microservice you want to send the received Json Web Token to. It may look like this:
{
"destinations": [ {
"name": "my-destination", "url": "http://localhost:1234", "forwardAuthToken": true
}]
}
Afterwards, inside the approuter directory you can simply run npm start which runs the approuter per default under http://localhost:5000. It also writes nice console output you can use to debug the parameters above.
EDIT: Turns out I was incorrect, it is apparently possible to run the approuter locally.
First of all, here is the documentation for the approuter: https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/01c5f9ba7d6847aaaf069d153b981b51.html
As far as I understood, you need to provide to files to the approuter for it to run locally, default-services.json and default-env.json (put them in the same directory as your package.json.
The default-services.json has a format like this:
{
"uaa": {
"url" : "http://my.uaa.server/",
"clientid" : "client-id",
"clientsecret" : "client-secret",
"xsappname" : "my-business-application"
}
}
The default-env.json is simply a json file holding the environment variables that the approuter needs to access, like so:
{
"VCAP_SERVICES": <env>,
...
}
Unfortunately, the documentation does not state which variables are required, therefore I cannot provide you with a working example.
Hope this helps you! Should you manage to get this running, I'm sure others would appreciate if you share your knowledge here.
I have a testing application written in java-selenium. This app tests e-shop whether it is possible to buy products and many other functionalities.
Few days ago, I added a new functionality that tests whether the payment was successful. In case the order was not successful, "#errorBox" is added into the URL, therefore I am checking whether the URL consists of this sequence:
public void paymentCheck() {
String URL = driver.getCurrentUrl();
if (URL.contains("#errorBox")) {
data.put("paymentFailed", "true");
} else {
data.put("paymentFailed", "false");
}
}
If there is "#errorBox", paymentFailed = true is added to the dataset. Then I check its presence:
.paymentCheck();
if (dataRow.get("paymentFailed").equals("true")) {
resultLine.addTestResultLineItem(
new TestResultLineItemMessage("ERROR: Payment declined, transaction was not accepted.").setResult(Result.FAIL)
);
driver.quit();
}
And the problem is: When debugging, the check works just fine. When the app is ran directly, test fails because the application skips setting result as FAILED and does not kill the driver either.
Any ideas what is wrong here?
Any help is appreciated,
Thanks
When in debug model, some latency insert between each step, when run directly, we should add some sleep/wait before driver.getCurrentUrl() too.
From my experience, generally payment take little long time.
The script is working fine in debug mode and is failing in normal run. This is a clear indication of latency. Include Thread.sleep(seconds) in your code. Though it is not recommended to use thread.sleep(), it is a better option, since we don't know the nature of the application. Else you can try Implicit wait or explicit wait condition in your code.
I'm working with the DFS Java API and was wondering whether anyone knows a simple way to configure a client-side timeout for service-calls that can be configured on the service context, for example?
I have experienced some rare occasions where a Documentum repository was not responding, that's why I am considering a general timeout for all DFS calls.
For testing a hanging service call, I created a dummy TBO implementation that simply blocks the thread for 10 minutes when updating the document:
#Override
public void saveEx(boolean keepLock, String versionLabels) throws DfException {
if (isNew() == false) {
try {
Thread.sleep(1000*60*10);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
super.saveEx(keepLock, versionLabels);
}
I'm not sure if this behaves exactly like a hanging service call, but at least in my tests it worked as expected - my invocations of the update method of the Object Service took about 10minutes.
Is there any configuration I have not yet found, or maybe a runtime-property to pass to the service context to configure the timeout?
I would prefer using existing features of DFS for this instead of implementing my own mechanism.
Have you tried editing the value in dfs-runtime.properties? I don't think the timeout can be context-specific, but you should be able to change it for the client as a whole.
Reposted from https://community.emc.com/message/3249#3249
"Please see the Server runtime startup settings section of the Deployment guide.
The following list describes the precedence that dfs-runtime.properties files take depending on their location:
local-dfs‑runtime.properties file in the local classpath
runtime properties file specified with ‑Ddfs.runtime.properties.file
dfs‑runtime.properties packaged with emc‑dfs‑rt.jar
For example, settings in the local-dfs‑runtime.properties file on the local classpath will take precedence of identical settings in the dfs‑runtime.properties file that is located in emc‑dfs‑rt.jar or the one specified with the ‑D parameter. The DFS application must be restarted after any changes to the configuration. As a best practice, use the provided configuration file that is deployed in the emc‑dfs‑rt.jar file for your base settings and use an external file to override settings that you specifically wish to change."