Spring cloud config server fetching properties from native location is not working - spring

Hi Please see the project structure of my config file
Include these lines in the yml file
spring.profiles.active=native
spring.cloud.config.server.native.searchlocations =classpath:config/{application}
Here I can able to fetch properties directly under service name ,but don't know how to fetch data from folders like australia,canada .Please help

I solved this issue by providing another search location path in the server . see the below changes
spring.cloud.config.server.native.searchlocations =classpath:config/{application},classpath:config/{application}/{label}
And from the client side I have to make sure that I am passing correct label.
spring.cloud.config.label=australia

Related

Spring batch reader changes to read file content from GCP cloud storage bucket

I have a pre existing springboot application like this one which uses spring batch to read a huge CSV file(size=1GB) from a local location and inserts the content after some changes to a database. Now, the file will be coming from a bucket in Google Cloud Platform(GCP). I am planning to use something like Inbound streaming channel adapter mentioned here. Is this feasible?If yes, what changes will be needed in the ItemReader of the batch? Or is there any other option I need to consider? Any suggestion is welcome.
The FlatFileItemReader works with any Resource implementation. So you could use an URLResource and point it to your file on GCP without having to download it.
Here’s a specific example for a CSV file using the URLResource:
URLResource ur = new URLResource("http://www.dukelearntoprogram.com/course2/java/food.csv");
for (CSVRecord record : ur.getCSVParser()) {
// print or process fields in record
String name = record.get("Name");
// other processing
}
This was extracted from non-official documentation.
by adding relevant dependencies and changing the local file path
->"flatFileItemReader.setResource(new FileSystemResource("src/main/resources/message.csv"));"
to this
->"flatFileItemReader.setResource(new UrlResource("storage.googleapis.com/test-mybucket/mycsv.csv"));"
will it work ??

Marklogic Spring Boot - Installing a Rest Endpoint

I am currently using the Marklogic spring boot demo. So far I have been able to add indexes, facets, front-end logic etc just fine.
Right now, I am trying to layer in some semantic logic into a rest endpoint.
I wrote a simple query into the query console, and attempted to add it to the src/main/ext folder so that it would get deployed by the ml-gradle bootrun.
Right now. This file will get deployed to the test-modules database, and is visible once saved (I can see it in explorer under URI /ext/my-endpoint. I also tried adding a folder named rest-api but that just adds it to /ext/rest-api/my-endpoint
At the top of the endpoint I have it declared as
`module namespace ext = "http://marklogic.com/rest-api/resource/my-endpoint";
However when I navigate to the URL it should be living at http://localhost:8090/LATEST/resources/my-endpoint?
It tells me it does not exist.
So I can see it in the modules database, but I can't use it on HTTP. the Query works in the query console (and is rather trivial, and-query of json-property-word-queries)
My question is:
How can I properly update the marklogic-spring-boot framework to properly deploy rest endpoints.
So I figured it out it seems.
Manually creating the file isn't registering the distribution workflow properly.
Instead I create the resource using ml-gradle
gradle mlCreateResource -PresourceName=my_endpoint
This will create a new folder called services, and create the endpoint for me, which can then have code over written.
Still not sure what gradle is doing special, so I can know what the proper way to do this manually would be, but at least it works.

Parse Server - Where does it store uploaded files

I am new to Parse Server (implementing it on Heroku and locally).
I have a basic question, when I upload a file using the ParseFile class, it provides me a URL and a fileobject. Where is this File being stored?
Is it being stored physically on a file system? Or in Mongodb?
Thank you!
I found a collection in Mongodb named fs.files. The files I uploaded were located there. I assume the Parse URL is generated as a redirect.

Parse "parse new" doesn't create configuration folder as expected

I am following this tutorial to use parse.com hosting,
https://parse.com/apps/quickstart#hosting/windows
It says a config folder with json file will be created with "parse new", but it doesn't, I only get the public and cloud folders. Not sure what's going wrong here. Anyone know where I can find a copy of the file and put into my folder, so I can configure it's public URL?
The guide says :
The config directory contains a JSON configuration file that you shouldn't normally need to deal with
And then afterwards says
In the 'Hosting' section of your app's settings, you'll see a field at the top that allows you to set your subdomain, e.g. your-custom-domain.parseapp.com.
Perhaps that is what you are looking for?

Dynamically updating config data codeigniter

I have created my custom config file to store information about site such as if it is online or offline like-vice.
For that I have created new file in config folder and stores default values in global $config[] array with my own index.
I want to update these config data dynamically with admins control eg. he can select to put site in offline mode.
For that I have used function
$this->config->set_item('config_array_index','value_to_set');
but, I don't know why it is not working for me ?
I am not able to see any update in my config file. Also I am autoloading my config file.
Am I missing something?
Setting a config item only applies to the current session - it does not overwrite your actually codeigniter files.
If you want to permanetly take a site offline, your'll need some sort of persistant storage, such as a value in a database that is checked/updated as needed
you can create an empty config file, within your config directory , and then append your data to it using a functionality like fwrite ( you can check for some other CI function to use ).
and add it to your autoload file .

Resources